# Copy the content of a file to the clipboard using xclip function copyfile() { if [[ -z $1 ]]; then echo "Usage: copy-file-to-clipboard " return 1 fi if ! command -v xclip &> /dev/null; then echo "xclip is not installed. Please install it first." return 1 fi if [[ ! -f $1 ]]; then echo "$1 is not a valid file." return 1 fi xclip -sel clip < "$1" echo "$1 content copied to clipboard." }