Differences
This shows you the differences between two versions of the page.
tech:linux:bash_date [2015/04/09 06:46] |
tech:linux:bash_date [2015/04/09 06:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Date formatting in bash shell ====== | ||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | TS=$(date +%Y%m%d_%H%M%S); | ||
+ | # | ||
+ | if [[ ! ("$#" == 1) ]]; then | ||
+ | echo "Usage for $0 : <xxxxxx> required as argument." | ||
+ | exit 1 | ||
+ | fi | ||
+ | </code> | ||