Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created March 18, 2012 08:56
Show Gist options
  • Save jankeesvw/2070059 to your computer and use it in GitHub Desktop.
Save jankeesvw/2070059 to your computer and use it in GitHub Desktop.
function and paramaters bash
uploadtotemp() {
if [ $# -lt 1 ]
then
echo -en "\033[0;31mError: Wrong number of arguments.\033[0m Expected one or two, got zero. \n\n Example usage:\n uploadtmp folder/ new-folder-name/ \n"
else
if [ $# -lt 2 ]; then
NEW_FILE_NAME=`date "+%Y%m%d%H%M%S"`-$1
else
NEW_FILE_NAME=$2
fi
growlnotify -m "start uploading to server, please wait"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment