Created
September 1, 2013 13:05
-
-
Save mtornwall/6404350 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
# Snarf a file or the output of a command into the | |
# X11 paste buffer using xclip(1). | |
if [ -z $1 ]; then | |
name=`basename $0` | |
echo "Usage: $name [command] <arg1> ... <argN>, or" | |
echo " $name [file]" | |
exit 1 | |
fi | |
if [ -f $1 ]; then | |
xclip -selection clipboard < $1 | |
else | |
$1 $2 $3 $4 $5 $6 $7 $8 $9 | xclip -selection clipboard | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment