Skip to content

Instantly share code, notes, and snippets.

@ElectricCoffee
Last active August 29, 2015 14:07
Show Gist options
  • Save ElectricCoffee/d29978ef54aec0cd1729 to your computer and use it in GitHub Desktop.
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
#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