summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-12-14 19:23:31 +0100
committerBruno Haible <bruno@clisp.org>2016-12-16 18:24:15 +0100
commitea0f8691df45880c536a04e42d3a7a46f21921ae (patch)
treedc8b5952c1d448811f96fcd984a5e1c93f192d48
parente8e46123cfe62170a2f7f79db6b471b66ae36947 (diff)
Make the greeting-2 test POSIX compliant and traceable through "sh -x".
* tests/greeting-2: Don't use the "set - ARGS" idiom. References: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Builtins.html http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
-rwxr-xr-xtests/greeting-24
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/greeting-2 b/tests/greeting-2
index f7d69e1..ab6b459 100755
--- a/tests/greeting-2
+++ b/tests/greeting-2
@@ -2,7 +2,7 @@
# Test very long --greeting argument, and also show skipping a test.
# (And one way to compute full moons.)
#
-# Copyright (C) 2001, 2006, 2014, 2015 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2006, 2014-2016 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
@@ -16,7 +16,7 @@ Wuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
EOF
# Werewolves cry at full moon only.
-set - `TZ=GMT date +"%Y %j %H %M %S"`
+set x `TZ=GMT date +"%Y %j %H %M %S"`; shift
year=$1; day=$2; hours=$3; minutes=$4; seconds=$5
years_since_2000=`expr $year - 2000`
days_since_2000=`expr '(' $years_since_2000 '*' 365 ')' + '(' '(' $years_since_2000 - 1 ')' / 4 ')' + $day`