Created
August 25, 2011 11:20
-
-
Save TaurusOlson/1170458 to your computer and use it in GitHub Desktop.
Display the date in various formats
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/bash | |
[[ $1 -eq -1 ]] && today=`date +%m/%d/%y` && echo $today | |
[[ $1 -eq -2 ]] && today=`date +%m-%d-%y` && echo $today | |
[[ $1 -eq -3 ]] && today=`date +%d/%m/%y` && echo $today | |
[[ $1 -eq -4 ]] && today=`date +%d-%m-%y` && echo $today | |
[ $# -ne 1 ] && | |
cat <<-EOF | |
Usage: today OPTION | |
Availabe OPTIONs: | |
-1: m/d/y | |
-2: m-d-y | |
-3: d/m/y | |
-4: d-m-y | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment