Skip to content

Commit

Permalink
test-lib.sh: Fixing grep for date detection on Mac OS X, thanks Dave!
Browse files Browse the repository at this point in the history
Signed-off-by: Emil Sit <[email protected]>
  • Loading branch information
doegox authored and sit committed Apr 20, 2009
1 parent a67d0de commit c490e77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,21 +450,21 @@ test_init_todo () {
#date --version
#date (GNU coreutils) 6.10
#...
if date --version 2>&1 |grep -q "GNU"; then
if date --version 2>&1 | grep -q "GNU"; then
DATE_STYLE=GNU
# on Mac OS X 10.5:
#date --version
#date: illegal option -- -
#usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ...
#[-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
elif date --version 2>&1 | grep -q "\-jnu"; then
elif date --version 2>&1 | grep -q -e "-jnu"; then
DATE_STYLE=Mac10.5
# on Mac OS X 10.4:
#date --version
#date: illegal option -- -
#usage: date [-nu] [-r seconds] [+format]
# date [[[[[cc]yy]mm]dd]hh]mm[.ss]
elif date --version 2>&1 |grep -q "\-nu"; then
elif date --version 2>&1 | grep -q -e "-nu"; then
DATE_STYLE=Mac10.4
fi

Expand Down

0 comments on commit c490e77

Please sign in to comment.