#!/bin/bash # Check if a filename is provided if [ -z "$1" ]; then echo "Usage: $0 " exit 1 fi # Use the provided filename filename="$1" # Check if the file exists if [ ! -f "$filename" ]; then echo "File not found: $filename" exit 1 fi # Copy the content of the file to the clipboard cat "$filename" | xclip -selection clipboard echo "Content of $filename copied to clipboard."