Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created January 2, 2015 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fjolnir/e24f806e39a3776033d5 to your computer and use it in GitHub Desktop.
Save fjolnir/e24f806e39a3776033d5 to your computer and use it in GitHub Desktop.
#!/bin/bash
PASTE_BUF=~/.cutpastebuf
function copy() {
echo "" > $PASTE_BUF
for arg in $@; do
echo "COPY:$arg" >> $PASTE_BUF
done
}
function cut() {
echo "" > $PASTE_BUF
for arg in $@; do
echo "CUT:$arg" >> $PASTE_BUF
done
}
function paste() {
while read line ; do
if [[ $line = "COPY:"* ]]; then
echo "cp -r ${line:5} ."
elif [[ $line = "CUT:"* ]]; then
echo "mv ${line:4} ."
fi
done < $PASTE_BUF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment