Created
March 18, 2012 08:56
-
-
Save jankeesvw/2070059 to your computer and use it in GitHub Desktop.
function and paramaters bash
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
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