-
-
Save GrayedFox/da5c2f78c141427dba9fa54effc7ba67 to your computer and use it in GitHub Desktop.
Copy contents of a file using xclip
This file contains 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 characters
#!/usr/bin/env bash | |
if [ $# -ne 1 ] ; then | |
echo "error: you must pass a single argument that is the file you wish to copy the contents of" | |
exit 1 | |
fi | |
FILE=$1 | |
xclip -selection clipboard < $FILE | |
# Copy the contents of a file using xclip (must install xclip if not present) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment