diff options
author | Chet Ramey <chet.ramey@case.edu> | 2012-05-02 08:28:58 -0400 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2012-05-02 08:28:58 -0400 |
commit | e107650cbfd18378f3c047a13560025c2dfe2fb5 (patch) | |
tree | f37f9157fc4dd608bdf96224ad376aade7c5ed1d /tests/printf3.sub | |
parent | 63817e33cd87b8a51e0bb5ab2e61e2402b30bbe2 (diff) | |
download | bash-e107650cbfd18378f3c047a13560025c2dfe2fb5.tar.gz |
commit bash-20120420 snapshot
Diffstat (limited to 'tests/printf3.sub')
-rw-r--r-- | tests/printf3.sub | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/printf3.sub b/tests/printf3.sub index 1925dd52..ec14fa34 100644 --- a/tests/printf3.sub +++ b/tests/printf3.sub @@ -5,12 +5,17 @@ SHELLSTART=$(date +%s) SECS=1275250155 export TZ=EST5EDT +case $SHELLSTART in +*s*) SHELLSTART=$(perl -e 'print time') ; DATESECS=false ;; # take a shot +*) DATESECS=true ;; +esac + printf "%()T\n" $SECS printf "%(abde)Z\n" -1 printf "%(%e-%b-%Y %T)T\n" $SECS -printf -v v1 "%(%e-%b-%Y %T)T\n" $(date +%s) +printf -v v1 "%(%e-%b-%Y %T)T\n" $( $DATESECS && date +%s || perl -e 'print time') printf -v v2 "%(%e-%b-%Y %T)T\n" -1 case $v1 in |