Skip to content

Instantly share code, notes, and snippets.

@ChrisPenner
Last active April 4, 2017 20:34
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 ChrisPenner/0e854f7cd79d7f0e053cc87fb6cb8dcb to your computer and use it in GitHub Desktop.
Save ChrisPenner/0e854f7cd79d7f0e053cc87fb6cb8dcb to your computer and use it in GitHub Desktop.
Copy-pasta commands
#!/bin/bash
# Use at your own risk :P
FOLDER="/tmp/copy-pasta"
if [ $# -lt 1 ]; then
cat << EOF
usage: copy <files>
EOF
exit 1
fi
if [ -d $FOLDER ]; then
rm -rf ${FOLDER:?}/*
else
mkdir $FOLDER
fi
cp -r "$@" $FOLDER
#!/bin/bash
# Use at your own risk :P
FOLDER="/tmp/copy-pasta"
if [ $# -gt 1 ]; then
cat << EOF
usage: pasta <destination dir>
EOF
exit 1
elif [ $# == 0 ]; then
DEST="."
else
DEST="$1"
fi
if [ ! -d $FOLDER ]; then
cat << EOF
Remember to copy before you pasta!
EOF
exit 1
fi
cp -r "$FOLDER"/* "$DEST"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment