Last active
August 29, 2015 14:07
-
-
Save ElectricCoffee/d29978ef54aec0cd1729 to your computer and use it in GitHub Desktop.
utility function to copy all the contents of a text file from the terminal
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 characters
#pbcopy only exists on OSX (as far as I know), for linux find an equivalent | |
function cp-file-contents() { | |
if [ $# -eq 0 ] | |
then echo "Missing arguments" | |
elif [ $# -gt 1 ] | |
then echo "Too many arguments" | |
else | |
cat $1 | pbcopy | |
echo "contens copied" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment