-
-
Save zewebdev1337/b042fde3ce2eb4637d0601de159c33c3 to your computer and use it in GitHub Desktop.
Revisions
-
zewebdev1337 created this gist
Oct 21, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash # Check if a filename is provided if [ -z "$1" ]; then echo "Usage: $0 <filename>" 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."