]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: use more POSIX shell features our test scripts
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 14 Jun 2012 11:13:58 +0000 (13:13 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 22 Jun 2012 12:24:38 +0000 (14:24 +0200)
Since commit 'v1.12-36-g2d68fd9' of 2012-05-07, "configure: search a
sturdy POSIX shell to be used in the testsuite", the shell running
our test script is assured to be a POSIX-conforming shell, so we can
use the more modern and flexible idioms and features that we couldn't
use when we also aimed at compatibility with non-POSIX Bourne shells,
like Solaris /bin/sh.

* t/README: Suggest to use POSIX shell features liberally in test cases,
with possible exception of Makefile recipes and configure shell code.
* Several tests: Adjust to use more POSIX shell features; e.g., $(...)
rather than `...`, $((...)) rather than `expr ...`, "if ! CMD; then ..."
instead of "if CMD; then :; else ...", and so on.
In several places, when using the 'test' built-in, prefer '-eq' over
'=' for numeric comparisons, and prefer "grep -c PATTERN FILE" over
"grep PATTERN FILE | wc -l".
Throw in other low-hanging easy improvements and fixlets while we are
at it.
* t/ax/depcomp.sh, t/ax/tap-summary-aux.sh, t/ax/tap-functions.sh,
defs, defs-static.in: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
326 files changed:
defs
t/README
t/ac-output-old.tap
t/acloca13.sh
t/acloca14.sh
t/acloca15.sh
t/acloca18.sh
t/aclocal-install-absdir.sh
t/aclocal-install-mkdir.sh
t/aclocal-path-install-serial.sh
t/aclocal-path-install.sh
t/aclocal-path-nonexistent.sh
t/aclocal-path.sh
t/aclocal-print-acdir.sh
t/aclocal7.sh
t/aclocal8.sh
t/add-missing.tap
t/amhello-binpkg.sh
t/amhello-cross-compile.sh
t/ar-lib.sh
t/ar-lib5b.sh
t/autodist-no-duplicate.sh
t/autodist-subdir.sh
t/autodist.sh
t/ax/depcomp.sh
t/ax/tap-functions.sh
t/ax/tap-summary-aux.sh
t/c-demo.sh
t/candist.sh
t/ccnoco.sh
t/ccnoco3.sh
t/check12.sh
t/check3.sh
t/check4.sh
t/color.sh
t/color2.sh
t/comment4.sh
t/comment7.sh
t/compile3.sh
t/compile4.sh
t/compile5.sh
t/compile6.sh
t/cond14.sh
t/cond15.sh
t/cond33.sh
t/cond35.sh
t/cond36.sh
t/cond42.sh
t/cond5.sh
t/cond6.sh
t/cond8.sh
t/condhook.sh
t/condhook2.sh
t/condman3.sh
t/copy.sh
t/cscope.tap
t/cygnus-no-installinfo.sh
t/dejagnu-siteexp-useredit.sh
t/dejagnu2.sh
t/dejagnu4.sh
t/depend.sh
t/depend4.sh
t/dirlist-abspath.sh
t/dist-auxdir-many-subdirs.sh
t/dist-auxfile.sh
t/dist-formats.tap
t/dist-included-parent-dir.sh
t/dist-missing-am.sh
t/dist-missing-included-m4.sh
t/dist-missing-m4.sh
t/dist-repeated.sh
t/distcheck-missing-m4.sh
t/distcheck-outdated-m4.sh
t/distcheck-override-infodir.sh
t/distcheck-pr9579.sh
t/distcom4.sh
t/distcom5.sh
t/distdir.sh
t/disthook.sh
t/distlinks.sh
t/distlinksbrk.sh
t/dollar.sh
t/empty.sh
t/exeext.sh
t/exeext3.sh
t/exeext4.sh
t/ext.sh
t/fn99.sh
t/fn99subdir.sh
t/fort4.sh
t/fort5.sh
t/gcj3.sh
t/gcj4.sh
t/gettext-macros.sh
t/gnits2.sh
t/gnits3.sh
t/hdr-vars-defined-once.sh
t/help-silent.sh
t/help4.sh
t/info.sh
t/install-info-dir.sh
t/installdir.sh
t/instdir-cond.sh
t/instdir-cond2.sh
t/instdir-java.sh
t/instdir-lisp.sh
t/instdir-ltlib.sh
t/instdir-no-empty.sh
t/instdir-prog.sh
t/instdir-python.sh
t/instdir-texi.sh
t/instdir.sh
t/instdir2.sh
t/instfail-info.sh
t/instfail-java.sh
t/instfail-libtool.sh
t/instfail.sh
t/insthook.sh
t/instman.sh
t/instmany-mans.sh
t/instmany-python.sh
t/instmany.sh
t/instspc.tap
t/java-check.sh
t/java-compile-install.sh
t/java-compile-run-flat.sh
t/java-compile-run-nested.sh
t/java-no-duplicate.sh
t/java-nobase.sh
t/java-noinst.sh
t/java-uninstall.sh
t/java.sh
t/java3.sh
t/lex-lib-external.sh
t/lex-noyywrap.sh
t/lex-pr204.sh
t/lex3.sh
t/library3.sh
t/libtool-macros.sh
t/libtool6.sh
t/libtool7.sh
t/lisp3.sh
t/lisp4.sh
t/lisp5.sh
t/lisp6.sh
t/lisp7.sh
t/lisp8.sh
t/longlin2.sh
t/longline.sh
t/ltcond.sh
t/ltconv.sh
t/ltinit.sh
t/ltorder.sh
t/maintmode-configure-msg.sh
t/make-dryrun.tap
t/makej2.sh
t/maken.sh
t/man2.sh
t/man4.sh
t/man5.sh
t/mdate5.sh
t/missing5.sh
t/mkinst2.sh
t/mkinst3.sh
t/mmodely.sh
t/multlib.sh
t/nobase-libtool.sh
t/nobase-python.sh
t/nobase.sh
t/nodist2.sh
t/notrans.sh
t/number.sh
t/objc-megademo.sh
t/objext-pr10128.sh
t/obsolete.sh
t/oldvars.sh
t/output8.sh
t/override-conditional-1.sh
t/override-html.sh
t/parallel-am.sh
t/parallel-tests-exit-statuses.sh
t/parallel-tests-interrupt.tap
t/parallel-tests-log-compiler-1.sh
t/parallel-tests-many.sh
t/parallel-tests-trailing-bslash.sh
t/parallel-tests.sh
t/parallel-tests2.sh
t/parallel-tests3.sh
t/phony.sh
t/pluseq5.sh
t/pluseq6.sh
t/pluseq7.sh
t/pluseq9.sh
t/posixsubst-data.sh
t/posixsubst-libraries.sh
t/posixsubst-ltlibraries.sh
t/posixsubst-programs.sh
t/posixsubst-scripts.sh
t/pr287.sh
t/pr300-lib.sh
t/pr300-ltlib.sh
t/pr300-prog.sh
t/pr87.sh
t/primary-prefix-couples-force-valid.sh
t/print-libdir.sh
t/py-compile-basedir.sh
t/py-compile-basic2.sh
t/py-compile-usage.sh
t/python-pr10995.sh
t/python-vars.sh
t/python-virtualenv.sh
t/python.sh
t/python10.sh
t/python12.sh
t/python3.sh
t/python5b.sh
t/python6.sh
t/python7.sh
t/python9.sh
t/remake-subdir-long-time.sh
t/remake11.sh
t/remake6.sh
t/remake9a.sh
t/remake9b.sh
t/remake9c.sh
t/remake9d.sh
t/self-check-cleanup.tap
t/self-check-dir.tap
t/self-check-explicit-skips.sh
t/self-check-me.tap
t/self-check-reexec.tap
t/self-check-sanity.sh
t/self-check-seq.tap
t/silent-many-gcc.sh
t/silent-many-generic.sh
t/specflg6.sh
t/specflg7.sh
t/specflg8.sh
t/spy.sh
t/stdlib.sh
t/strip.sh
t/strip2.sh
t/strip3.sh
t/subobj-clean-lt-pr10697.sh
t/subobj-clean-pr10697.sh
t/subobj11a.sh
t/subobj11b.sh
t/subobj9.sh
t/subobjname.sh
t/subst-no-trailing-empty-line.sh
t/subst3.sh
t/substtarg.sh
t/suffix.sh
t/suffix2.sh
t/symlink.sh
t/tap-bailout-suppress-later-errors.sh
t/tap-basic.sh
t/tap-diagnostic-custom.sh
t/tap-diagnostic.sh
t/tap-fancy.sh
t/tap-fancy2.sh
t/tap-global-log.sh
t/tap-global-result.sh
t/tap-log.sh
t/tap-more.sh
t/tap-no-spurious-numbers.sh
t/tap-no-spurious.sh
t/tap-number-wordboundary.sh
t/tap-out-of-order.sh
t/tap-plan-malformed.sh
t/tap-plan-middle.sh
t/tap-planskip-case-insensitive.sh
t/tap-planskip-late.sh
t/tap-planskip-later-errors.sh
t/tap-planskip.sh
t/tap-realtime.sh
t/tap-signal.tap
t/tap-unplanned.sh
t/tar-override.sh
t/tar3.sh
t/target-cflags.sh
t/test-driver-create-log-dir.sh
t/test-driver-custom-multitest.sh
t/test-driver-custom-xfail-tests.sh
t/test-driver-custom.sh
t/test-driver-is-distributed.sh
t/test-driver-strip-vpath.sh
t/test-extensions-cond.sh
t/test-extensions.sh
t/test-log.sh
t/test-metadata-global-result.sh
t/test-metadata-recheck.sh
t/test-trs-basic.sh
t/testsuite-summary-count.sh
t/transform.sh
t/transform2.sh
t/transform3.sh
t/txinfo19.sh
t/txinfo21.sh
t/txinfo26.sh
t/txinfo27.sh
t/txinfo29.sh
t/txinfo30.sh
t/txinfo32.sh
t/txinfo9.sh
t/uninstall-fail.sh
t/uninstall-pr9578.sh
t/vala-mix.sh
t/vala-vapi.sh
t/vala.sh
t/vala4.sh
t/vala5.sh
t/vartypo2.sh
t/vartypos.sh
t/version6.sh
t/vtexi3.sh
t/vtexi4.sh
t/warnings-win-over-strictness.sh
t/warnopts.sh
t/werror4.sh
t/yacc-basic.sh
t/yacc-cxx.sh
t/yacc-dist-nobuild.sh
t/yacc-pr204.sh
t/yacc8.sh
t/yflags-force-conditional.sh

diff --git a/defs b/defs
index 612855e0881277b2d56d4e3b52f8163da6575a7b..77d616ec3ccddfdf50d98296d08a2a185d312f19 100644 (file)
--- a/defs
+++ b/defs
@@ -254,7 +254,7 @@ cross_compiling ()
 # Resolve ties in favor of FILE.
 is_newest ()
 {
-  is_newest_files=`find "$@" -prune -newer "$1"`
+  is_newest_files=$(find "$@" -prune -newer "$1")
   test -z "$is_newest_files"
 }
 
@@ -344,7 +344,7 @@ extract_configure_help ()
   am__opt_re='' am__var_re=''
   case $1 in
     --*'=')   am__opt_re="^  $1";;
-    --*'[=]') am__opt_re='^  '`printf '%s\n' "$1" | sed 's/...$//'`'\[=';;
+    --*'[=]') am__opt_re='^  '$(printf '%s\n' "$1" | sed 's/...$//')'\[=';;
     --*)      am__opt_re="^  $1( .*|$)";;
       *)      am__var_re="^  $1( .*|$)";;
   esac
@@ -507,24 +507,10 @@ seq_ ()
     3) seq_first=$1 seq_incr=$2 seq_last=$3;;
     *) fatal_ "seq_: too many arguments";;
   esac
-  # Try to avoid forks if possible.
-  case "$BASH_VERSION" in
-    ""|[12].*)
-      : Not bash, or a too old bash version. ;;
-    *)
-      # Use eval to protect dumber shells from parsing errors.
-      eval 'for ((i = seq_first; i <= seq_last; i += seq_incr)); do
-              echo $i
-            done'
-      return 0;;
-  esac
-  # Else, use GNU seq if available.
-  seq "$@" && return 0
-  # Otherwise revert to a slower loop using expr(1).
   i=$seq_first
   while test $i -le $seq_last; do
     echo $i
-    i=`expr $i + $seq_incr`
+    i=$(($i + $seq_incr))
   done
 }
 
@@ -561,12 +547,12 @@ count_test_results ()
     # Avoid spurious failures with shells with "overly sensible"
     # errexit shell flag, such as e.g., Solaris /bin/sh.
     set +e
-    test `grep -c '^PASS:'  stdout` -eq $pass  || rc=1
-    test `grep -c '^XFAIL:' stdout` -eq $xfail || rc=1
-    test `grep -c '^SKIP:'  stdout` -eq $skip  || rc=1
-    test `grep -c '^FAIL:'  stdout` -eq $fail  || rc=1
-    test `grep -c '^XPASS:' stdout` -eq $xpass || rc=1
-    test `grep -c '^ERROR:' stdout` -eq $error || rc=1
+    test $(grep -c '^PASS:'  stdout) -eq $pass  || rc=1
+    test $(grep -c '^XFAIL:' stdout) -eq $xfail || rc=1
+    test $(grep -c '^SKIP:'  stdout) -eq $skip  || rc=1
+    test $(grep -c '^FAIL:'  stdout) -eq $fail  || rc=1
+    test $(grep -c '^XPASS:' stdout) -eq $xpass || rc=1
+    test $(grep -c '^ERROR:' stdout) -eq $error || rc=1
     grep "^# TOTAL:  *$total$" stdout || rc=1
     grep "^# PASS:  *$pass$"   stdout || rc=1
     grep "^# XFAIL:  *$xfail$" stdout || rc=1
@@ -602,7 +588,8 @@ commented_sed_unindent_prog='
 unindent ()
 {
   if test x"$sed_unindent_prog" = x; then
-    sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/  *# .*//"`
+    sed_unindent_prog=$(printf '%s\n' "$commented_sed_unindent_prog" \
+                          | sed -e "s/  *# .*//")
   fi
   sed "$sed_unindent_prog" ${1+"$@"}
 }
@@ -787,10 +774,8 @@ do
         MAKE=$make_ am__using_gmake=''
         test "$MAKE" =  : && break
         echo "$me: determine whether $MAKE is GNU make"
-        # Don't use "&&" here, or a bug of 'set -e' present in some
-        # versions of the BSD shell will be triggered.  We add the
-        # dummy "else" branch for extra safety.
-        if using_gmake; then break; else :; fi
+        using_gmake && break
+        : For shells with busted 'set -e'.
       done
       test "$MAKE" = : && skip_all_ "this test requires GNU make"
       export MAKE
@@ -862,12 +847,13 @@ do
                      "the '--html' option"
       ;;
     mingw)
-      uname_s=`uname -s || echo UNKNOWN`
+      uname_s=$(uname -s || echo UNKNOWN)
       echo "$me: system name: $uname_s"
       case $uname_s in
         MINGW*) ;;
         *) skip_all_ "this test requires MSYS in MinGW mode" ;;
       esac
+      unset uname_s
       ;;
     non-root)
       # Skip this test case if the user is root.
@@ -894,9 +880,7 @@ do
       # Don't use "&&" here, to avoid a bug of 'set -e' present in
       # some (even relatively recent) versions of the BSD shell.
       # We add the dummy "else" branch for extra safety.
-      if cross_compiling; then
-        skip_all_ "doesn't work in cross-compile mode"
-      else :; fi
+      ! cross_compiling || skip_all_ "doesn't work in cross-compile mode"
       ;;
     python)
       # Python doesn't support --version, it has -V
index 5f967d271b0df3199ad64ef04b10302f61c57d03..57cab89d4f5a5085a3dd51bed3227749ec5a5441 100644 (file)
--- a/t/README
+++ b/t/README
@@ -278,6 +278,22 @@ Do
 Do not
 ------
 
+  In test scripts, prefer using POSIX constructs over their old
+  Bourne-only equivalents:
+
+    - use $(...), not `...`, for command substitution;
+    - use $((...), not `expr ...`, for arithmetic processing;
+    - liberally use '!' to invert the exit status of a command, e.g.,
+      in idioms like "if ! CMD; then ...", instead of relying on clumsy
+      paraphrases like "if CMD; then :; else ...".
+    - prefer use of ${param%pattern} and ${param#pattern} parameter
+      expansions over processing by 'sed' or 'expr'.
+  
+  Note however that, when writing Makefile recipes or shell code in a
+  configure.ac, you should still use `...` instead, because the Autoconf
+  generated configure scripts do not ensure they will find a truly POSIX
+  shell (even though they will prefer and use it *if* it's found).
+
   Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
   years we'll discover that this test failed for some other bogus reason.
   This happened many times.  Better use something like
index 5ba3d3e3a901ac4cfe5af98453282ef7253245e9..06b17caa28f5ddb0bdbf789fecdebfa75b430f81 100755 (executable)
@@ -146,7 +146,7 @@ mkdir subdir
 command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
 command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
 command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
-             test `$FGREP foo.in Makefile.in | wc -l` -eq 2
+             test $($FGREP -c 'foo.in' Makefile.in) -eq 2
 
 # This ought to work as well.
 command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
index e91a534ed6381c03721062e1870b818d8ce1236f..aab2dafb6658a19fbc973bf70f31540aabd867b3 100755 (executable)
@@ -61,9 +61,11 @@ $sleep
 touch m4/otherfile.m4
 $sleep
 $ACLOCAL -I m4
-test `ls -1t aclocal.m4 m4/otherfile.m4 | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 m4/otherfile.m4 | sed 1q) = aclocal.m4
 
 $AUTOCONF
 $AUTOMAKE
 ./configure
 $MAKE distcheck
+
+:
index ba1f072286fcf2c3ea85606d1639277add72c94d..c36538f08a24ec4d6b734c0463722416c506dced 100755 (executable)
@@ -91,7 +91,7 @@ EOF
 $MAKE
 
 # Because c.m4 has changed, aclocal.m4 must have been rebuilt.
-test `ls -1t aclocal.m4 stamp | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 stamp | sed 1q) = aclocal.m4
 # However, since FOO is not used, f.m4 should not be included
 # and the contents of aclocal.m4 should remain the same
 diff aclocal.m4 stamp
index 690c06c6726470948f305206d6294f94f50e4ae2..01d11de03950da988a91fab43f9319bb01323a30 100755 (executable)
@@ -42,6 +42,6 @@ $ACLOCAL -I m4
 $FGREP AM_SOME_MACRO aclocal.m4 && Exit 1
 $FGREP AM_MORE_MACRO aclocal.m4 && Exit 1
 $FGREP 'm4_include([m4/more.m4])' aclocal.m4
-test 1 = `grep m4_include aclocal.m4 | wc -l`
+test 1 = $(grep m4_include aclocal.m4 | wc -l)
 
 :
index c0510e10d949bff055ae3debaee4818bdf2116fe..4ae03ff0719d7b772be8cc482d4f7e2f04d942fe 100755 (executable)
@@ -128,7 +128,7 @@ grep 'installing.*4/m1\.m4' stderr
 
 $ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
-test `grep -c 'ill-formed serial' stderr` -eq 3
+test $(grep -c 'ill-formed serial' stderr) -eq 3
 
 $ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
index b07f7fac91a45d6d396566ecca7be121c7fa43de..1c9938ebfbbbca4630473cb8532ad49a6ad8b76b 100755 (executable)
@@ -26,7 +26,7 @@ mkdir loc sys
 echo 'AM_DUMMY_MACRO' >> configure.ac
 echo 'AC_DEFUN([AM_DUMMY_MACRO], [:])' >> sys/foo.m4
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
 env ACLOCAL_PATH="$cwd/sys" $ACLOCAL --verbose --install -I "$cwd/loc"
 diff sys/foo.m4 loc/foo.m4
 
index ba4be2a64f926d57c7b8794c12be937c27c0dac2..86cf8031af07ffe7f4dd431c699fbae2ba14b974 100755 (executable)
@@ -36,7 +36,7 @@ ACLOCAL="$ACLOCAL --system-acdir=sys-acdir"
 $ACLOCAL -I foo --install
 test -f foo/my-defs.m4
 
-$ACLOCAL --install -I "`pwd`/bar"
+$ACLOCAL --install -I "$(pwd)/bar"
 test -f bar/my-defs.m4
 
 $ACLOCAL --install -I baz/sub/sub2
@@ -54,10 +54,10 @@ ls zardoz2 | grep . && Exit 1
 
 # Directories in ACLOCAL_PATH should never be created if they don't
 # exist.
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install && Exit 1
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install && Exit 1
 test ! -d none
 test ! -d none2
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install -I x
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install -I x
 test -f x/my-defs.m4
 test ! -d none
 test ! -d none2
index 8a2b22c59803109e00f1660db515af63c3c44e60..c238a7868325cf7a76c85c71247a5a80915578d6 100755 (executable)
@@ -57,7 +57,7 @@ win ()
 
 mkdir sdir pdir m4
 
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/sdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/sdir"
 ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
 
 cat > sdir/foo.m4 << 'END'
index a9a8b97c60f2afb51c4e6772c6709e1392425472..71d718cec7819201da83fbf8a2f129d4fa1f91bd 100755 (executable)
@@ -26,7 +26,7 @@ END
 
 mkdir acdir pdir ldir
 
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/acdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/acdir"
 ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
 
 cat > acdir/foo.m4 << 'END'
index 8c42ddc65f388f09f5b168c6adad2134f14740e4..3eb042aad4ce23eb8b94cf1050eae060b553f8a4 100755 (executable)
@@ -27,7 +27,7 @@ END
 mkdir mdir
 echo 'AC_DEFUN([AM_FOO], [am--foo])' > mdir/foo.m4
 
-ACLOCAL_PATH=./nonesuch:./mdir:`pwd`/nonesuch2:nonesuch3 $ACLOCAL
+ACLOCAL_PATH=./nonesuch:./mdir:$(pwd)/nonesuch2:nonesuch3 $ACLOCAL
 $AUTOCONF
 $FGREP 'am--foo' configure
 
index d1279f0213248d5dc687d93308c7e42cf1b38e25..72b3938976b70a1974ea4c9ebd92b6a90d8630cc 100755 (executable)
@@ -40,7 +40,7 @@ cat > mdir3/baz.m4 << 'END'
 AC_DEFUN([AM_BAZ_MACRO], [am--baz])
 END
 
-ACLOCAL_PATH=mdir1:./mdir2:`pwd`/mdir3 $ACLOCAL
+ACLOCAL_PATH=mdir1:./mdir2:$(pwd)/mdir3 $ACLOCAL
 $AUTOCONF
 
 # there should be no m4_include in aclocal.m4, even though ACLOCAL_PATH
index 3d8bf4e7df07c61f3b53935101ee037724c925ee..ef61b2f62a6c2122c34f54d96cda85569d839db6 100755 (executable)
@@ -20,15 +20,15 @@ am_create_testdir=empty
 . ./defs || Exit 1
 
 $ACLOCAL --print-ac-dir
-test "`$ACLOCAL --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --print-ac-dir)" = "$am_system_acdir"
 
 $ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir
-test "`$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir`" = foo
+test "$($ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir)" = foo
 
 $ACLOCAL --system-acdir /bar --print-ac-dir
-test "`$ACLOCAL --system-acdir /bar --print-ac-dir`" = /bar
+test "$($ACLOCAL --system-acdir /bar --print-ac-dir)" = /bar
 
 $ACLOCAL --automake-acdir /bar --print-ac-dir
-test "`$ACLOCAL --automake-acdir /bar --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --automake-acdir /bar --print-ac-dir)" = "$am_system_acdir"
 
 :
index 548d890177293aa167230eb9d4517698b5474645..ce84983a2a8c5205d80ba8ce1950b32ec7cf4f04 100755 (executable)
@@ -55,17 +55,17 @@ $AUTOMAKE --no-force
 
 # aclocal.m4 and Makefile.in should not have been updated, so 'foo'
 # should be younger
-test `ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q) = foo
 
 $sleep
 $ACLOCAL -I m4 --force
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 foo | sed 1q) = aclocal.m4
 # We still use --no-force for automake, but since aclocal.m4 has
 # changed all Makefile.ins should be updated.
 $sleep
 $AUTOMAKE --no-force
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
 
 touch m4/somedefs.m4
 $sleep
@@ -76,9 +76,9 @@ $sleep
 $AUTOMAKE --no-force
 
 # aclocal.m4 should have been updated, although its contents haven't changed.
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t aclocal.m4 foo | sed 1q) = aclocal.m4
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
 
 touch fragment.inc
 $sleep
@@ -87,9 +87,9 @@ $sleep
 $ACLOCAL -I m4
 $AUTOMAKE --no-force
 # Only ./Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t aclocal.m4 foo | sed 1q) = foo
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = foo
 
 grep README Makefile.in && Exit 1
 
@@ -99,8 +99,8 @@ touch foo
 $sleep
 $AUTOMAKE --no-force
 # Even if no dependency change, the content changed.
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = foo
 
 grep README Makefile.in
 
@@ -111,6 +111,6 @@ $sleep
 $ACLOCAL -I m4
 $AUTOMAKE --no-force
 # Only sub/Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = foo
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t aclocal.m4 foo | sed 1q) = foo
+test $(ls -1t Makefile.in foo | sed 1q) = foo
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
index 8df0835bcf3b3c9c420340f07675f82ee32cefee..869969eb6eddb66385b4370cded990af1e841105 100755 (executable)
@@ -35,7 +35,7 @@ echo 'AC_DEFUN([MACRO1],)' >m4/macro1.m4
 echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
 
 $ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; }
-test 0 = `wc -l <output`
+test 0 -eq $(wc -l <output)
 grep macro1.m4 aclocal.m4
 grep macro2.m4 aclocal.m4 && Exit 1
 
index 39b7ae7f648ac8112fb3fe3266fb29b7ca2022d0..6f16a0ae6563c77b7773999ef821438202c898dc 100755 (executable)
@@ -25,7 +25,7 @@ am_create_testdir=empty
 plan_ "later"
 
 build_aux=build-aux
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
 # Try to improve readability of displayed diffs.
 if diff -u /dev/null /dev/null; then
@@ -79,7 +79,7 @@ check_count=0
 check_ ()
 {
   set +x # Temporary disable shell traces to remove noise from log files.
-  incr_ check_count
+  check_count=$(($check_count + 1))
   echo check count: $check_count
   override=no
   run_aclocal=no
@@ -280,7 +280,7 @@ END
 
 # For config.guess and config.sub.
 for mach in build host target system; do
-  MACH=`echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]'`
+  MACH=$(echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]')
   check_ <<END
 == Name ==
 cfg-$mach
index 4b3e0e21b1091eb5d951187ae2fd98ffcfc8c8b7..16fdfc3b8d36fa4030cdd035187fe6dc479dfb6b 100755 (executable)
@@ -28,12 +28,12 @@ cd amhello-1.0
 
 ./configure --prefix /usr
 $MAKE
-$MAKE DESTDIR="`pwd`/inst" install
+$MAKE DESTDIR="$(pwd)/inst" install
 cd inst
 find . -type f -print > ../files.lst
-tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > tar.got 2>&1
+tar cvf amhello-1.0-i686.tar.gz $(cat ../files.lst) > tar.got 2>&1
 
-EXEEXT=`sed -n -e 's/^EXEEXT *= *//p' < ../Makefile`
+EXEEXT=$(sed -n -e 's/^EXEEXT *= *//p' < ../Makefile)
 
 if tar --version </dev/null | grep GNU; then
   LC_ALL=C sort tar.got > t
index b138d87c8519a582764bb44b028ecc6b67a78b4f..26093cffa3e89d071d87e3a6145e5852527e0232 100755 (executable)
@@ -25,7 +25,7 @@ cp "$am_docdir"/amhello-1.0.tar.gz . \
   || fatal_ "cannot get amhello tarball"
 
 host=i586-mingw32msvc
-build=`"$am_scriptdir"/config.guess` && test -n "$build" \
+build=$("$am_scriptdir"/config.guess) && test -n "$build" \
   || fatal_ "cannot guess build platform"
 case $build in *mingw*) skip_ "build system is MinGW too";; esac
 
index 1ddec64d8d9a37d3843f997b9b47e9bf9f524606..1d6b588dbed4cc5d0c9b4c427ee46de82fc4c2b9 100755 (executable)
@@ -37,77 +37,77 @@ END
 chmod +x ./lib
 
 # Check if ar-lib can create an archive with "cr".
-opts=`./ar-lib ./lib cr foo.lib foo.obj`
+opts=$(./ar-lib ./lib cr foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
 
 # Check if ar-lib can update an existing archive with "r".
 touch foo.lib
-opts=`./ar-lib ./lib r foo.lib foo.obj`
+opts=$(./ar-lib ./lib r foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib can update an existing archive with "q".
-opts=`./ar-lib ./lib q foo.lib foo.obj`
+opts=$(./ar-lib ./lib q foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib accepts "u" as a modifier.
 # NOTE: "u" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib ru foo.lib foo.obj`
+opts=$(./ar-lib ./lib ru foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib accepts "s" as a modifier.
-opts=`./ar-lib ./lib rs foo.lib foo.obj`
+opts=$(./ar-lib ./lib rs foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib accepts "S" as a modifier.
-opts=`./ar-lib ./lib rS foo.lib foo.obj`
+opts=$(./ar-lib ./lib rS foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
 
 # Check if ar-lib passes on @FILE with "r"
-opts=`./ar-lib ./lib r foo.lib @list`
+opts=$(./ar-lib ./lib r foo.lib @list)
 test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
 
 # Check if ar-lib can delete a member from an archive with "d".
-opts=`./ar-lib ./lib d foo.lib foo.obj`
+opts=$(./ar-lib ./lib d foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
 
 # Check if ar-lib can delete members in an @FILE.
 echo foo.obj > foolist
-opts=`./ar-lib ./lib d foo.lib @foolist`
+opts=$(./ar-lib ./lib d foo.lib @foolist)
 test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
 
 # Check if ar-lib can list archive members with "t".
-opts=`./ar-lib ./lib t foo.lib`
+opts=$(./ar-lib ./lib t foo.lib)
 test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
 
 # Check if ar-lib accepts "v" as a modifier.
 # NOTE: "v" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib tv foo.lib`
+opts=$(./ar-lib ./lib tv foo.lib)
 test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
 
 # Check if ar-lib can extract archive members with "x".
 touch fake.lib
-opts=`./ar-lib ./lib x fake.lib`
+opts=$(./ar-lib ./lib x fake.lib)
 test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
 
 # Check if ar-lib can extract specified archive members with "x".
-opts=`./ar-lib ./lib x foo.lib foo.obj`
+opts=$(./ar-lib ./lib x foo.lib foo.obj)
 test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib can extract members in an @FILE.
-opts=`./ar-lib ./lib x foo.lib @foolist`
+opts=$(./ar-lib ./lib x foo.lib @foolist)
 test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib passes -lib and -LTCG through to the wrappee.
-opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+opts=$(./ar-lib ./lib -lib -LTCG x foo.lib foo.obj)
 test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
 
 # Check if ar-lib can extract backslashed members.
 touch fake2.lib
-opts=`./ar-lib ./lib x fake2.lib`
+opts=$(./ar-lib ./lib x fake2.lib)
 test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
 
 # Check if ar-lib accepts "s" as an action.
-opts=`./ar-lib ./lib s foo.lib`
+opts=$(./ar-lib ./lib s foo.lib)
 test x"$opts" = x
 
 :
index 2fb0cf43e4ae292c4828e77240d2874efef9b79e..30a44a8ea3a7d7d55123e6a86c42f20ae455d690 100755 (executable)
@@ -80,7 +80,7 @@ case " $* " in
 esac
 END
 chmod +x bin/lib
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
 $ACLOCAL
 $AUTOCONF
index 90a2c7dfcab6aeb2a87888b1e0a6a11b7b62290a..2e610ae021421067b91412ec565cb12c183b7f8e 100755 (executable)
@@ -27,12 +27,12 @@ re='Files .*automatically distributed.*if found'
 list1=`$AUTOMAKE --help \
         | sed -n "/^$re.*always/,/^ *$/p" \
         | sed 1d`
-list1=`echo $list1`
+list1=$(echo $list1)
 
 list2=`$AUTOMAKE --help \
         | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
         | sed 1d`
-list2=`echo $list2`
+list2=$(echo $list2)
 
 test -n "$list1"
 test -n "$list2"
index 5e1f044e9b038ff41f6dc1875f08828b2f03d29f..19d22dc4f2d4506633ae4490e294a929601f6ad4 100755 (executable)
@@ -40,7 +40,7 @@ list=`$AUTOMAKE --help \
         | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
         | sed 1d`
 # Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
 
 test -n "$list"
 
index e6435c54c9bc7327881702bd68bac6bfb8b4c35b..f8f68ad248884e9adc4afe60f6d52ae63631b380 100755 (executable)
@@ -39,7 +39,7 @@ list=`$AUTOMAKE --help \
         | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
         | sed 1d`
 # Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
 
 test -n "$list"
 
index a9180e9379bc27b4da4b547817977dd7ebde75a7..7a602291aab1786b17881bb185936f55707d410e 100644 (file)
@@ -69,7 +69,7 @@
 
 # This expects ./defs has already been included has already been included..
 
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 longpath=this-is/a-path/which-has/quite-a/definitely/truly/long_long_name
 cachevar=am_cv_CC_dependencies_compiler_type
 
@@ -343,7 +343,7 @@ do_test ()
     absolute)
       mkdir -p vpath-abs/build
       cd vpath-abs/build
-      absdir="`(cd .. && pwd)`" || fatal_ "getting absolute directory"
+      absdir=$(cd .. && pwd) || fatal_ "getting absolute directory"
       setup_srcdir "$absdir/vpath-abs"
       unset absdir
       ;;
index 3a5db030974317166aa62626ce7b349d1d01e575..eebcbe989a72574edc0ece415955191b435a758b 100644 (file)
@@ -31,24 +31,10 @@ tap_fail_count_=0
 tap_xfail_count_=0
 tap_xpass_count_=0
 
-# The first "test -n" tries to avoid extra forks when possible.
-if test -n "${ZSH_VERSION}${BASH_VERSION}" \
-     || (eval 'test $((1 + 1)) = 2') >/dev/null 2>&1
-then
-  # Outer use of 'eval' needed to protect dumber shells from parsing
-  # errors.
-  eval 'incr_ () { eval "$1=\$((\${$1} + 1))"; }'
-else
-  incr_ () { eval "$1=\`expr \${$1} + 1\`"; }
-fi
-
 # not COMMAND [ARGS...]
 # ---------------------
 # Run the given command and invert its exit status.
-not ()
-{
-  if "$@"; then return 1; else return 0; fi
-}
+not () { ! "$@"; }
 
 # plan_ [unknown|later|lazy|now|NUMBER-OF-PLANNED-TESTS]
 # ------------------------------------------------------
@@ -136,14 +122,20 @@ result_ ()
     ""|TODO|SKIP) ;;
     *) bailout_ "result_: invalid directive '$directive_'" ;;
   esac
-  incr_ tap_count_
+  tap_count_=$(($tap_count_ + 1))
   case $tap_result_,$tap_directive_ in
-    ok,) incr_ tap_pass_count_;;                # Passed.
-    not\ ok,TODO) incr_ tap_xfail_count_;;      # Expected failure.
-    not\ ok,*) incr_ tap_fail_count_ ;;         # Failed.
-    ok,TODO) incr_ tap_xpass_count_ ;;          # Unexpected pass.
-    ok,SKIP) incr_ tap_skip_count_ ;;           # Skipped.
-    *) bailout_ "internal error in 'result_'";; # Can't happen.
+    ok,)                                                # Passed.
+      tap_pass_count_=$(($tap_pass_count_ + 1))         ;;
+    not\ ok,TODO)                                       # Expected failure.
+      tap_xfail_count_=$(($tap_xfail_count_ + 1))       ;;
+    not\ ok,*)                                          # Failed.
+      tap_fail_count_=$(($tap_fail_count_ + 1))         ;;
+    ok,TODO)                                            # Unexpected pass.
+      tap_xpass_count_=$(($tap_xpass_count_ + 1))       ;;
+    ok,SKIP)                                            # Skipped.
+      tap_skip_count_=$(($tap_skip_count_ + 1))         ;;
+    *)                                                  # Can't happen.
+      bailout_ "internal error in 'result_'"            ;;
   esac
   tap_text_="$tap_result_ $tap_count_"
   if test x"$*" != x; then
@@ -169,7 +161,7 @@ skip_ () { result_ 'ok' -D SKIP ${1+"$@"}; }
 skip_row_ ()
 {
   skip_count_=$1; shift
-  for i_ in `seq_ $skip_count_`; do skip_ ${1+"$@"}; done
+  for i_ in $(seq_ $skip_count_); do skip_ ${1+"$@"}; done
 }
 
 # skip_all_ [REASON ...]
index f5d1fbdfef97e2802db69cf395e6f1dfc1ddd24e..2fadb3d2b796c838e82ff31621b77927982eae1e 100644 (file)
@@ -311,7 +311,7 @@ done > tap
 
 # Lots of non-failures (300 per kind).
 (cat tap && cat tap && cat tap) > all.test
-test `wc -l <all.test` -eq 900 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 900 || Exit 99 # Sanity check.
 echo 1..900 >> all.test # Test plan.
 do_check --pass <<END
 $success_header
@@ -327,7 +327,7 @@ END
 
 # 1 failure and lots of non-failures means failure.
 (cat tap && echo "not ok" && cat tap) > all.test
-test `wc -l <all.test` -eq 601 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 601 || Exit 99 # Sanity check.
 echo 1..601 >> all.test # Test plan.
 do_check --fail <<END
 $failure_header
@@ -343,7 +343,7 @@ END
 
 # 1 error and lots of non-failures means failure.
 (cat tap && sed 30q tap && echo 'Bail out!') > all.test
-test `wc -l <all.test` -eq 331 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 331 || Exit 99 # Sanity check.
 echo 1..331 >> all.test # Test plan.
 do_check --fail <<END
 $failure_header
index ed2a109cd53c656b1bccd0fea8d2f16c699a8100..c461876e0687d9e3f25f9c33edb5aed51e369761 100755 (executable)
@@ -169,7 +169,7 @@ if ! cross_compiling && ! grep "[ $tab]depmode=none" Makefile; then
   mv -f t lib/bar.h
   $MAKE
   ./src/zardoz
-  test "`./src/zardoz`" = 'Foo, Zap!'
+  test "$(./src/zardoz)" = 'Foo, Zap!'
 fi
 
 $MAKE clean
index 88d8854fd38949dab04c0ede2156514ee1cf6418..aaa40d499d69232af105f8ba3d8ebab168bf3038 100755 (executable)
@@ -27,6 +27,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-test 2 -eq `grep -c 'dist.*forbidden' stderr`
+test 2 -eq $(grep -c 'dist.*forbidden' stderr)
 
 Exit 0
index 1df950da8a81912aee9a317db2de21c01542cf5f..60898c8d1026f7fbab5e7f4afe403a51532c669c 100755 (executable)
@@ -60,7 +60,7 @@ END
 chmod +x Mycomp
 
 # Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/Mycomp
+CC=$(pwd)/Mycomp
 export CC
 
 $ACLOCAL
index eb291ecd5adc5b7c21accf5ec38314da023d744b..b47ed48f30af530172dd65cbf288e50e7860ac2b 100755 (executable)
@@ -58,6 +58,10 @@ END
 
 chmod +x Mycomp
 
+# Make sure the compiler doesn't understand '-c -o'
+CC=$(pwd)/Mycomp
+export CC
+
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --copy --add-missing
@@ -65,10 +69,6 @@ $AUTOMAKE --copy --add-missing
 mkdir build
 cd build
 
-# Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/../Mycomp
-export CC
-
 ../configure
 $MAKE 2>stderr || { cat stderr >&2; Exit 1; }
 cat stderr >&2
index dbb3101df0cb16351701a2b193b1f94789df0dec..839f24fc3341bfb329b9ab6a3be924d1a5aaa131 100755 (executable)
@@ -136,12 +136,11 @@ for vpath in : false; do
   test -f hammer.sum
   test -f spanner.log
   test -f spanner.sum
-  # This checks will be run only by the autogenerated 'check12-p.test'.
   if test x"$am_serial_tests" != x"yes"; then
     test -f test-suite.log
     test -f a.log
     test -f b.log
-  else :; fi
+  fi
   grep 'check-local succeeded :-)' local.log
 
   cp -f config.status config-status.sav
@@ -168,7 +167,6 @@ for vpath in : false; do
   grep 'FAIL:' spanner.sum && Exit 1
 
   B_EXIT_STATUS=1 $MAKE check && Exit 1
-  # This checks will be run only by the autogenerated 'check12-p.test'.
   if test x"$am_serial_tests" != x"yes"; then
     cat test-suite.log
     cat a.log
@@ -179,7 +177,7 @@ for vpath in : false; do
     grep '^b\.test: exit status: 1$' test-suite.log
     grep '^a\.test' test-suite.log && Exit 1
     : For shells with busted 'set -e'.
-  else :; fi
+  fi
 
   CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
   grep 'check-local failed :-(' local.log
@@ -192,7 +190,6 @@ for vpath in : false; do
   test -f spanner.sum
   grep 'FAIL: test_hammer' hammer.sum
   grep 'FAIL:' spanner.sum && Exit 1
-  # This checks will be run only by the autogenerated 'check12-p.test'.
   if test x"$am_serial_tests" != x"yes"; then
     cat test-suite.log
     cat a.log
@@ -203,7 +200,7 @@ for vpath in : false; do
     grep '^b\.test: exit status: 23$' test-suite.log
     grep '^a\.test' test-suite.log && Exit 1
     : For shells with busted 'set -e'.
-  else :; fi
+  fi
   grep 'check-local failed :-(' local.log
 
   cd $srcdir
index 69b6a674cea03642ae2bb10951e02c216532b59e..b4858e0ebbf4b8c8cc921d5ed43298cb9d9147b5 100755 (executable)
@@ -56,7 +56,7 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
index 78415e08d48be9c148aba47712a1a99e718a138b..49043c786452e03606c05b0ef2bf2518764a8fa3 100755 (executable)
@@ -49,7 +49,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 
 $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
index 6f5c902b9a537341505bcc2a691e831be808a0ef..18c6e232adf395e7d6b1103ab465ace9e55f5b14 100755 (executable)
@@ -32,7 +32,7 @@ std="$esc\[m"
 # Check that grep can parse nonprinting characters.
 # BSD 'grep' works from a pipe, but not a seekable file.
 # GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
+case $(echo "$std" | grep .) in
   "$std") ;;
   *) skip_ "grep can't parse nonprinting characters";;
 esac
index b073d5cb34c88af0fb7bb538eb74743a235c3345..041ffe6e83fc30ad4e3e1e9c59a886ca97fd2f0d 100755 (executable)
@@ -32,7 +32,7 @@ std="$esc\[m"
 # Check that grep can parse nonprinting characters.
 # BSD 'grep' works from a pipe, but not a seekable file.
 # GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
+case $(echo "$std" | grep .) in
   "$std") ;;
   *) skip_ "grep can't parse nonprinting characters";;
 esac
index 42e7bf9ad9f583556c3ea7109f5e453865fdf344..efd703631ea4f3cd8fee4f98ae2fe253c8f8a3b8 100755 (executable)
@@ -31,9 +31,11 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
-# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file
-test `sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' Makefile.in \
-      | wc -l` -le 30
+# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file.
+test $(sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' \
+                 Makefile.in | wc -l) -le 30
 # UnIqUe_MUMBLE_COMMENT should appear right before the mumble declaration.
-test `sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' Makefile.in \
-      | wc -l` -eq 2
+test $(sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' \
+                 Makefile.in | wc -l) -eq 2
+
+:
index 5637fb7b6c22db3e357d846ee7d3f25047ffcef1..634cc203774328ec9fe64007dd393f9259a35889 100755 (executable)
@@ -36,9 +36,11 @@ EOF
 $ACLOCAL
 $AUTOMAKE
 
+$FGREP '@COND' Makefile.in # For debugging, mostly.
+
 # The VAR definition appears once for each condition.
-test `grep '@COND_TRUE@VAR' Makefile.in | wc -l` = 1
-test `grep '@COND_FALSE@VAR' Makefile.in | wc -l` = 1
+test $(grep -c '@COND_TRUE@VAR' Makefile.in) = 1
+test $(grep -c '@COND_FALSE@VAR' Makefile.in) = 1
 
 # Make sure the right definition follows each comment.
 sed -n '/^#.*VAR.*COND_TRUE/ {
@@ -51,3 +53,5 @@ sed -n '/^#.*VAR.*COND_FALSE/ {
           p
         }' Makefile.in |
   grep '@COND_FALSE@VAR = bar'
+
+: 
index 009de7023b8886f33475c6d57d61118ec42404e5..a1cc479a84b07d19d17aa782dacf681632cf3188 100755 (executable)
@@ -34,25 +34,29 @@ chmod +x ./cl
 # -l and -L options and their respective arguments.  Traditionally,
 # this should work also without a space.  Try both usages.
 for sp in '' ' '; do
+
   # Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
-  opts=`LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk -I${sp}baz -Xlinker foobar -Wl,-foo,bar`
-  test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+  opts=$(LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk \
+                             -I${sp}baz -Xlinker foobar -Wl,-foo,bar)
+  test x"$opts" = \
+       x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
 
   # Check if compile handles "-o foo.obj"
-  opts=`./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+  opts=$(./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
   test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
 
   # Check if compile handles "-o foo.o"
-  opts=`./compile ./cl -c foo.c -o foo.o -I${sp}baz`
+  opts=$(./compile ./cl -c foo.c -o foo.o -I${sp}baz)
   test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
 
   # Check if compile handles "foo.cc" as C++.
-  opts=`./compile ./cl -c foo.cc -o foo.o -I${sp}baz`
+  opts=$(./compile ./cl -c foo.cc -o foo.o -I${sp}baz)
   test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
 
   # Check if compile clears the "eat" variable properly.
-  opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+  opts=$(eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
   test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
 done
 
 :
index bb9f6719c47afbb9a1c0df652b02c634b3000547..8e516e3e5ccb2aa59ff5b3bddcaf7e35e69a4f43 100755 (executable)
@@ -25,25 +25,24 @@ get_shell_script compile
 mkdir sub
 
 cat >sub/foo.c <<'EOF'
-int
-foo ()
+int foo (void)
 {
   return 0;
 }
 EOF
 
 cat >main.c <<'EOF'
-extern int foo ();
-int
-main ()
+extern int foo (void);
+int main (void)
 {
   return foo ();
 }
 EOF
 
-absfoodir=`pwd`/sub
-absmainc=`pwd`/main.c
-absmainobj=`pwd`/main.obj
+cwd=$(pwd) || fatal_ "cannot get current directory"
+absfoodir=$cwd/sub
+absmainc=$cwd/main.c
+absmainobj=$cwd/main.obj
 
 cat >> configure.ac << 'END'
 AC_PROG_CC
@@ -84,9 +83,8 @@ fi
 # this should work also without a space.  Try both usages.
 for sp in '' ' '; do
   rm -f main
-
-  ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" -o main -l${sp}foo
-
+  ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" \
+               -o main -l${sp}foo
   ./main
 done
 
index 02afca3fd8feb2beb3c72b42848f978db97c6d8f..0f787cce8ce3aa12a3b6b062787f91a5e2f0709f 100755 (executable)
@@ -62,7 +62,7 @@ $AUTOMAKE -a
 ./configure
 . ./check_host
 
-pwd=`pwd`
+cwd=$(pwd) || fatal_ "cannot get current directory"
 
 # POSIX mandates that the compiler accepts a space between the -I,
 # -l and -L options and their respective arguments.  Traditionally,
@@ -70,15 +70,10 @@ pwd=`pwd`
 for sp in '' ' '; do
   # Check if "compile cl" transforms absolute file names to
   # host format (e.g /somewhere -> c:/msys/1.0/somewhere).
-
-  res=`./compile ./cl -L${sp}"$pwd" | sed -e 's/-link -LIBPATH://'`
-
+  res=$(./compile ./cl -L${sp}"$cwd" | sed -e 's/-link -LIBPATH://')
   case $res in
-    ?:[\\/]*)
-      ;;
-    *)
-      Exit 1
-      ;;
+    ?:[\\/]*) ;;
+    *) Exit 1 ;;
   esac
 done
 
index 9db337328ea29294ef8a2b1719cb6109357fc228..3979802ee363b8f96e0d5b5f071e07fbe138abe8 100755 (executable)
@@ -34,72 +34,74 @@ chmod +x ./cl
 # -l and -L options and their respective arguments.  Traditionally,
 # this should work also without a space.  Try both usages.
 for sp in '' ' '; do
+
   rm -rf lib lib2 syslib "sys  lib2"
 
   mkdir syslib
-  :> syslib/foo.lib
+  : > syslib/foo.lib
 
-  syslib=`pwd`/syslib
+  syslib=$(pwd)/syslib
   LIB=$syslib
   export LIB
 
   mkdir lib
-  :> lib/bar.lib
-  :> lib/bar.dll.lib
+  : > lib/bar.lib
+  : > lib/bar.dll.lib
 
   # Check if compile library search correctly
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
 
   # Check if -static makes compile avoid bar.dll.lib
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
 
-  :> syslib/bar.lib
-  :> syslib/bar.dll.lib
+  : > syslib/bar.lib
+  : > syslib/bar.dll.lib
 
   # Check if compile finds bar.dll.lib in syslib
-  opts=`./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
 
   # Check if compile prefers -L over $LIB
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
 
   mkdir lib2
-  :> lib2/bar.dll.lib
+  : > lib2/bar.dll.lib
 
   # Check if compile avoids bar.dll.lib in lib2 when -static
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
 
   # Check if compile gets two different bar libraries when -static
   # is added in the middle
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar)
   test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
 
   # Check if compile gets the correct bar.dll.lib
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
 
   # Check if compile gets the correct bar.dll.lib
-  opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
 
   mkdir "sys  lib2"
-  :> "sys  lib2/foo.dll.lib"
+  : > "sys  lib2/foo.dll.lib"
 
-  syslib2="`pwd`/sys  lib2"
+  syslib2="$(pwd)/sys  lib2"
   LIB="$syslib2;$LIB"
 
   # Check if compile handles spaces in $LIB and that it prefers the order
   # in a multi-component $LIB.
-  opts=`./compile ./cl foo.c -o foo -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
 
   # Check if compile handles the 2nd directory in a multi-component $LIB.
-  opts=`./compile ./cl foo.c -o foo -static -l${sp}foo`
+  opts=$(./compile ./cl foo.c -o foo -static -l${sp}foo)
   test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+
 done
 
 :
index f3725c3af5bcca817d6cf8ea7714086e0398627d..7f300e88e405ace4f1ba0971f0182e7886fe42a1 100755 (executable)
@@ -46,6 +46,6 @@ $ACLOCAL
 $AUTOMAKE
 
 $FGREP helldl Makefile.in # For debugging.
-test `$FGREP -c 'helldl$(EXEEXT):' Makefile.in` -eq 2
+test $($FGREP -c 'helldl$(EXEEXT):' Makefile.in) -eq 2
 
 :
index 68f70fd47c7c5ad85a322ca06689738f1273a29d..8ee799b2f8ff26537d1c163f2f680af5f7eef55f 100755 (executable)
@@ -53,8 +53,8 @@ $ACLOCAL
 $AUTOMAKE
 
 $FGREP helldl Makefile.in # For debugging.
-num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
-num2=`$FGREP '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
+num1=$($FGREP -c 'helldl$(EXEEXT):' Makefile.in)
+num2=$($FGREP -c '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in)
 test $num1 -eq 4
 test $num2 -eq 1
 
index 9655d3b1ea879f389fea2971a0d4e9f315e204f5..d8b608749cd17720579930ecdf71729eba07734d 100755 (executable)
@@ -47,7 +47,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-cwd=`pwd` || fatal_ "cannot get current directory"
+cwd=$(pwd) || fatal_ "cannot get current directory"
 mkdir nowhere
 chmod a-w nowhere
 
index 043b3b059e73832b671eff37cdb0173b56d9b6a8..a870902098765dde044887c121f321ff150e9849 100755 (executable)
@@ -55,7 +55,7 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 $FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 1
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 1
 
 cat > tscan.l << 'END'
 %{
index 82200cca9151f4e99880ffbf14e2c628b1d1701c..d9b06990875e126c2b6440cb12b6f64479e18524 100755 (executable)
@@ -54,7 +54,7 @@ $AUTOMAKE -Wno-error
 
 # Still and all, it should generate two rules.
 $FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 2
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 2
 $FGREP '@CASE_A_TRUE@tparse.h:' Makefile.in
 $FGREP '@CASE_A_FALSE@tparse.h:' Makefile.in
 
index d4eee010429e610963f9d2f6479339948dd9e21f..c21772612d611f1b9d8fe0f2e774b0b0ddcfee94 100755 (executable)
@@ -54,6 +54,6 @@ _AM_COND_ENDIF/'
 AUTOMAKE_fails
 grep '^configure\.ac:7:.* not enough arguments.* _AM_COND_IF' stderr
 grep '^configure\.ac:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
-test 2 = `grep -c 'not enough arguments' stderr`
+test 2 -eq $($FGREP -c 'not enough arguments' stderr)
 
 :
index 3961303509439e40192bcdded1fe20cfabf5b397..8accd67690af655ffad5bdb73aa013e731b5e949 100755 (executable)
@@ -45,8 +45,8 @@ $ACLOCAL
 $AUTOMAKE 2>stderr &
 pid=$!
 
-# MSYS bash seems to have a bug in kill, so don't try to kill too soon;
-# and avoid maintainer-check test.
+# MSYS bash seems to have a bug in kill, so don't try to kill too soon.
+# The extra quoting avoids a maintainer-check failure.
 sleep '2'
 
 # Make at most 30 tries, one every 10 seconds (= 300 seconds = 5 min).
@@ -55,7 +55,7 @@ while test $try -le 30; do
   if kill -0 $pid; then
     : process $pid is still alive, wait and retry
     sleep '10'
-    try=`expr $try + 1`
+    try=$(($try + 1))
   else
     cat stderr >&2
     # Automake must fail with a proper error message.
index f6a499d1cc28e2412aec975661f711a5cf0af26e..42fa4077927dcefb4edb08fb55dc170f02e757d5 100755 (executable)
@@ -57,7 +57,7 @@ touch aclocal.m4 # Avoid unnecessary firing the remake rules.
 $AUTOCONF
 $AUTOMAKE Makefile
 
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
 
 $MAKE test
 
index f21aacba9883931b767259369282c5ef27f751ae..c498b75829cc048721e3d8b252fc27b8861ce02b 100755 (executable)
@@ -58,7 +58,7 @@ END
 
 cp x.c y.c
 
-instdir=`pwd`/_inst || fatal_ "cannot get current directory"
+instdir=$(pwd)/_inst || fatal_ "cannot get current directory"
 
 # Skip the rest of the test in case of e.g. missing C compiler.
 ./configure --prefix="$instdir" x=yes || Exit $?
index 3b0f89c2a2d977c8f0cbf61a59dcb8ac9fee846b..bcd05510e36766f994ffc2c3f696c0e92edc184c 100755 (executable)
@@ -39,7 +39,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 
 $MAKE install
 test -f inst/etc/mumble
index a853e37a2d930936d42ef40f96679ceb6cde6aca..f68332c6f3f422d5a71c043077c42bf3f382a339 100755 (executable)
@@ -38,7 +38,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 
 $MAKE install
 test -f inst/etc/mumble
index 9f2714ffe6770a1b53afc77217a5bbb4e228f62c..89196dfb708d802b5da033a4173fc22f175cc6bd 100755 (executable)
@@ -58,14 +58,14 @@ $EGREP 'MANS|\.([123456789]|man)' Makefile.in # For debugging.
 
 mkdir build
 cd build
-../configure FOO=true --prefix="`pwd`/_inst"
+../configure FOO=true --prefix="$(pwd)/_inst"
 $EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
 touch foo.1 6.man
 $MAKE install
 $MAKE test1
 
 cd ..
-./configure FOO=false --prefix="`pwd`/_inst"
+./configure FOO=false --prefix="$(pwd)/_inst"
 $EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
 touch bar.2 baz.1 zap.5
 $MAKE install
index a9f0f5616d98e0f0c9b19762ce74c9b7f055488d..9ae7292a138cc0618f822455bd49d0b95b1b348c 100755 (executable)
--- a/t/copy.sh
+++ b/t/copy.sh
@@ -77,7 +77,7 @@ test -f auxdir/install-sh
 is_symlink auxdir/install-sh
 test -f auxdir/depcomp
 is_not_symlink auxdir/depcomp
-test FAKE-DEPCOMP = `cat auxdir/depcomp`
+test FAKE-DEPCOMP = "$(cat auxdir/depcomp)"
 
 # 'automake -a -c' should not create symlinks, even when there are
 # already symlinked required auxiliary files.
index dbc4993753a1f4fead4edb1e94c5752d0ef6cc84..f1f0c4e7c9798a33aea9e02828d51ab4654fe232 100755 (executable)
@@ -20,7 +20,7 @@
 
 plan_ 18
 
-ocwd=`pwd` || fatal_ "getting top-level directory"
+ocwd=$(pwd) || fatal_ "getting top-level directory"
 
 cat >> configure.ac << 'END'
 AC_CONFIG_FILES([sub/Makefile])
index d46b6b36f5a13f9d19c74c35100545c2ac455a74..2de752d036889f117f2f2cdaf90484799f7ea8f8 100755 (executable)
@@ -40,7 +40,7 @@ $ACLOCAL
 $AUTOMAKE --cygnus -Wno-override -Wno-obsolete
 $AUTOCONF
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || Exit 1
 ./configure --prefix="$cwd"/_inst
 $MAKE
 $MAKE install
index 9be5eba90c7379d9e5889a3fbdb6e0bbab55fff9..63fc18b5483d86b99dbacdbd2a9773e972a5ff82 100755 (executable)
@@ -56,7 +56,7 @@ $MAKE site.exp
 cat site.exp
 is_newest site.exp Makefile  # Sanity check.
 grep '|objdir|' site.exp
-test `grep -c '|objdir|' site.exp` -eq 1
+test $($FGREP -c '|objdir|' site.exp) -eq 1
 
 # We can do a "more semantic" check if DejaGnu is available.
 if runtest SOMEPROGRAM=someprogram --version; then
index 0a0d0910fdabd77e9a7793a930762181a23cb3e2..8feb5de9afce42b3fd0e2fb8861b5e175ec78bb6 100755 (executable)
@@ -34,7 +34,7 @@ $AUTOCONF
 $AUTOMAKE -Wno-override
 
 grep 'site\.exp' Makefile.in
-test `grep -c '^site\.exp:' Makefile.in` -eq 1
+test $(grep -c '^site\.exp:' Makefile.in) -eq 1
 
 ./configure
 $MAKE site.exp
index 44904dfbfd7fc447352db7c7196863cbeca86d57..1c94798932c0aa9b7d3eae25d9741e29ff25ea23 100755 (executable)
 # Check that the DejaGnu rules work for a simple program and test case.
 # Also check PR 488: Failure of the first of several tools tested.
 # From the original bug report:
-# ``If you use dejagnu for testing and have multiple tools (i.e.,
+#   If you use dejagnu for testing and have multiple tools (i.e.,
 #   multiple entries in the DEJATOOL variable) then the success/failure
 #   of "make check" is only dependent on the success/failure of the
 #   tests on the final tool. Thus there may be failures in the tests on
-#   previous tools, but at first glance "make check" has passed.''
+#   previous tools, but at first glance "make check" has passed.
 
 required=runtest
 . ./defs || Exit 1
index a2e3bd866d7c7e4c561cbf7ff148539fed65f65b..b69427dd6e2745366627960068e85fbe2b44c01d 100755 (executable)
@@ -31,4 +31,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
+
+:
index d9896f860bfb26d95cf9269a48f01697fff97c8e..e3ace0bbceb73fb2c57ac7eaf37f62202b4ded5a 100755 (executable)
@@ -30,7 +30,7 @@ for header in one.h two.h three.h four.h five.h six.h; do
     fred_SOURCES = fred1.c $headers
 END
   $AUTOMAKE
-  test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+  test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
 done
 
 :
index 78af8b1f2a48f328fab441294cb4cc2d23f69a62..f33f4451677baa0038161ffb3d844e6fb6624a4f 100755 (executable)
@@ -20,7 +20,7 @@ am_create_testdir=empty
 . ./defs || Exit 1
 
 mkdir acdir-more sub sub/acdir
-echo "`pwd`/acdir-more" > sub/acdir/dirlist
+echo "$(pwd)/acdir-more" > sub/acdir/dirlist
 
 echo 'AC_DEFUN([AM_FOO], [foo-foo--foo])' > acdir-more/foo.m4
 
index f84514a793de67ced91b26a7eaa5bed7c9616218..50d04f332fda23cdfd8943e9b4c036434eb931c4 100755 (executable)
@@ -22,7 +22,7 @@ required=cc
 . ./defs || Exit 1
 
 count=0
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
 # Usage: do_check [--add-missing] [CONFIG-AUXDIR-PATH=.]
 do_check ()
@@ -33,7 +33,7 @@ do_check ()
   esac
   auxdir=${1-.}
 
-  count=`expr $count + 1`
+  count=$(($count + 1))
   mkdir T$count.d
   cd T$count.d
 
index 9f7e8eee7bb89f9962b97b003b104fa4f9fa5978..500f6b8076a6a4ae1f686da1de5c16e8fb63c062 100755 (executable)
@@ -27,7 +27,7 @@ for auxdir in build-aux ''; do
 
   echo "*** Testing with auxdir '$auxdir' ***"
 
-  i=`expr $i + 1`
+  i=$(($i + 1))
   mkdir T$i.d
   cd T$i.d
 
index 26c6c97d745e212aabd5388bb1125d95c4fc7497..ac6853b8eeae89dd867d786a7eb4c0ea60b8e8fc 100755 (executable)
@@ -26,7 +26,7 @@ plan_ 70
 #  Common and/or auxiliary subroutines and variables.  #
 # ---------------------------------------------------- #
 
-ocwd=`pwd` || fatal_ "obtaining current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 TAR='' && unset TAR
 
@@ -66,45 +66,56 @@ setup_vars_for_compression_format ()
   esac
 }
 
+have_compressor ()
+{
+  test $# -eq 1 || fatal_ "have_compressor(): bad usage"
+  case $1 in
+    # Assume gzip(1) is available on every reasonable portability target.
+    gzip)
+      return 0;;
+    # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
+    # and is just a dummy script that is not able to actually compress
+    # (it can only decompress).  So, check that the 'compress' program
+    # is actually able to compress input.
+    # Note that, at least on GNU/Linux, 'compress' does (and is
+    # documented to) exit with status 2 if the output is larger than
+    # the input after (attempted) compression; so we need to pass it
+    # an input that it can actually reduce in size when compressing.
+    compress)
+      for x in 1 2 3 4 5 6 7 8; do
+        echo aaaaaaaaaaaaaaaaaaaaa
+      done | compress -c >/dev/null && return 0
+      return 1
+      ;;
+    *)
+      # Redirect to stderr to avoid polluting the output, in case this
+      # function is used in a command substitution (as it is, below).
+      if $1 --version </dev/null >&2; then
+        return 0
+      else
+        return 1
+      fi
+      ;;
+  esac
+  fatal_ "have_compressor(): dead code reached"
+}
+
 all_compression_formats='gzip tarZ lzip xz bzip2 zip shar'
 
-all_compressors=`
+all_compressors=$(
   for x in $all_compression_formats; do
     setup_vars_for_compression_format $x
     echo $compressor
-  done | tr "$nl" ' '`
+  done | tr "$nl" ' ')
 echo All compressors: $all_compressors
 
-missing_compressors=`
+missing_compressors=$(
   for c in $all_compressors; do
-    case $c in
-      # Assume gzip(1) is available on every reasonable portability target.
-      gzip)
-        continue
-        ;;
-      # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
-      # and is just a dummy script that is not able to actually compress
-      # (it can only decompress).  So, check that the 'compress' program
-      # is actually able to compress input.
-      # Note that, at least on GNU/Linux, 'compress' does (and is
-      # documented to) exit with status 2 if the output is larger than
-      # the input after (attempted) compression; so we need to pass it
-      # an input that it can actually reduce in size when compressing.
-      compress)
-        for x in 1 2 3 4 5 6 7 8; do
-          echo aaaaaaaaaaaaaaa
-        done | $c -c >/dev/null && continue
-        : For shells with busted 'set -e'.
-        ;;
-      *)
-        $c --version </dev/null >&2 && continue
-        : For shells with busted 'set -e'.
-        ;;
-    esac
-    echo $c
-  done | tr "$nl" ' '`
+    have_compressor $c || echo $c
+  done | tr "$nl" ' ')
 echo Missing compressors: $missing_compressors
 
+# Redefine to avoid re-running the already executed checks.
 have_compressor ()
 {
   case " $missing_compressors " in *\ $1\ *) false;; *) : ;; esac
@@ -122,8 +133,8 @@ start_subtest ()
   if test $# -gt 0; then
     eval "$@" || fatal_ "start_subtest: evaluating assignments"
   fi
-  ac_opts=`echo $ac_opts | tr ',' ' '`
-  am_opts=`echo $am_opts | tr ',' ' '`
+  ac_opts=$(echo $ac_opts | tr ',' ' ')
+  am_opts=$(echo $am_opts | tr ',' ' ')
   mkdir "$name"
   cd "$name"
   unindent > configure.ac <<END
@@ -171,7 +182,7 @@ can_compress ()
         && $MAKE dist-$format \
         && test -f $tarname-1.0.$suffix \
         && ls -l *$tarname* \
-        && test "`ls *$tarname*`" = $tarname-1.0.$suffix'
+        && test "$(echo *$tarname*)" = $tarname-1.0.$suffix'
 
   unset suffix compressor format tarname
 }
@@ -188,7 +199,7 @@ command_ok_ "default [configure]"       ./configure
 command_ok_ "default [make distcheck]"  $MAKE distcheck
 
 command_ok_ "'make dist' only builds *.tar.gz by default" \
-            test "`ls *defaults*`" = defaults-1.0.tar.gz
+            test "$(ls *defaults*)" = defaults-1.0.tar.gz
 
 rm -rf *defaults*
 
@@ -430,7 +441,7 @@ ls -l # For debugging.
 cd ..
 
 oPATH=$PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
 command_ok_ \
   "$desc ['make dist-all', stubbed]" \
index ae135aee405248ed4b7ce1c1de0cff72581fb3ff..a74c6dbeb1aa514e6c3c59706b085619887b52ae 100755 (executable)
@@ -45,5 +45,7 @@ $AUTOCONF
 $AUTOMAKE
 # Use --srcdir with an absolute path because it's harder
 # to support in 'distdir'.
-./configure --srcdir "`pwd`"
+./configure --srcdir "$(pwd)"
 $MAKE test
+
+:
index 0765b0c59ac8da5eea14a916a32fbea89b9ea2a5..3390884e23649fd801ed2724e426da3a83d37027 100755 (executable)
@@ -39,7 +39,7 @@ $AUTOMAKE
 
 # A faulty distribution tarball, with a required '.am' file missing.
 # Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 for vpath in false :; do
   $MAKE distdir
   test -f $distdir/zardoz.am # Sanity check.
index 59600036cbbb3c4bc97b46679a7f4989e4cdf2eb..b2835ee83137bce1a5866fdd779e4332297551c2 100755 (executable)
@@ -41,7 +41,7 @@ $AUTOMAKE
 
 # A faulty distribution tarball, with a required '.m4' file missing.
 # Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 for vpath in false :; do
   $MAKE distdir
   test -f $distdir/zardoz.m4 # Sanity check.
index 9a418d31618040daca78cb3ec851d31050791208..b8284cbf1565d979b0b490c762bd846a7344e04a 100755 (executable)
@@ -43,7 +43,7 @@ $AUTOMAKE
 
 # A faulty distribution tarball, with a required '.m4' file missing.
 # Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 for vpath in false :; do
   $MAKE distdir
   test -f $distdir/m4/zardoz.m4 # Sanity check.
index 6651e72c950dc079857fa7d8553ac64c58125d9b..f67d17e6b12af7bbbc7127a7ac65c116fe8082e1 100755 (executable)
@@ -45,7 +45,7 @@ pythondir = ${prefix}/py
 PYTHON = false
 END
 
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
 # Help to ensure cp won't see the same file twice.
 mkdir bin
@@ -80,7 +80,7 @@ esac
 exec cp "\$@"
 END
 chmod a+x bin/cp
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH;
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH;
 
 : > foo.c
 : > bar.py
index e583be12f86ea9bfac950d7df87c63f4eaaa86f4..051e52d14446db97f48b9e17454c9d2dcedba495 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || Exit 1
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
 
 cp "$am_testauxdir"/distcheck-hook-m4.am . \
   || fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
index 71ae3dd2178191deea28f4e80f23fdb82a0dce97..ac8ce5419ac890a4376aea2afe8ae4aa7bf08f21 100755 (executable)
@@ -20,7 +20,7 @@
 
 . ./defs || Exit 1
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
 
 cp "$am_testauxdir"/distcheck-hook-m4.am . \
   || fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
index 746b5f85961cff7731109434a08e0d8d0e436cbb..4aaf268c872d920b6654eb1e725adce5d1c946f4 100755 (executable)
@@ -55,7 +55,7 @@ $AUTOCONF
 $MAKE
 
 $MAKE distcheck
-infodir="`pwd`"/_info $MAKE -e distcheck
+infodir="$(pwd)/_info" $MAKE -e distcheck
 test -f _info/dir || Exit 99 # Sanity check.
 
 :
index 8c789001e119e847288674982788661975dd0eff..0b205e8bbdab6937dad5aa4b04b25e5cfc05a3c9 100755 (executable)
@@ -42,7 +42,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 # Sanity checks.
 $MAKE install
index dc37fcf4f62a6e01bde0f9e35f42c8510898251e..32d3db2ac74bd04d47381073509daafc479eaee7 100755 (executable)
@@ -69,7 +69,7 @@ sed -n -e '/^DIST_COMMON =.*\\$/ {
 
 cat dc.txt # For debugging.
 
-test 1 = `grep tests dc.txt | wc -l`
+test 1 -eq $(grep -c tests dc.txt)
 grep configure dc.txt
 # README must come first.
 grep 'DIST_COMMON = README' Makefile.in
index adfbe52d10ef8b4555fa7e8cc1e78498f239c04c..de6ea11b4926e1e713b0140570900b0b36235bc1 100755 (executable)
@@ -78,7 +78,7 @@ extract_distcommon tests/Makefile.in > inner.txt
 cat top.txt
 cat inner.txt
 
-test 0 = `grep tests top.txt | wc -l`
-test 1 = `grep wrapper inner.txt | wc -l`
+test 0 -eq $(grep -c tests top.txt)
+test 1 -eq $(grep -c wrapper inner.txt)
 
 :
index 0657928dc2fbbf949f79b600cfd78a8c2f6e7b28..41a9a8c7b439e97106d1af21e65d77f8e5cc41c2 100755 (executable)
@@ -76,7 +76,7 @@ cat stdout
 grep 'MKDIR_P.*\.' stdout && Exit 1
 
 cd ..
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
 $MAKE distcheck
 
 :
index 9804e9942d8581ce20463c995ff69f321a0918b4..98f086d351857b4792176c9fc58db5372d4918f5 100755 (executable)
@@ -71,7 +71,7 @@ chmod a-x execute
 $MAKE distdir
 ls -l $distdir $distdir/doc
 cd $distdir
-test "`cat write`" = "all is ok"
+test "$(cat write)" = "all is ok"
 test ! -f removed
 test ! -r removed
 test -f doc/README
@@ -82,7 +82,6 @@ test ! -r doc/HACING
 ./execute | grep 'I run successfully'
 cd ..
 
-
 $MAKE distcheck
 test -f distcheck-run
 
index 08244c06ee8b7c73bb0c1eaa6fe06d484f43d0be..97b5b49e66f9ab46a5d089986c68b3b04eca5372 100755 (executable)
@@ -36,7 +36,7 @@ ln -s foo  bar1
 ln -s bar1 bar2
 ln -s bar2 bar3
 
-ln -s "`pwd`/foo" quux
+ln -s "$(pwd)/foo" quux
 
 cat >> configure.ac << 'END'
 AC_OUTPUT
index b7732ca632d17ae098b886c7beac26e5b44ad429..cf0556e93b2402dfe515bee72f3392a637fad62a 100755 (executable)
@@ -29,7 +29,7 @@ lnkb=${lnk_base}__bbb
 
 ln -s nonesuch $lnk1 || skip_ "cannot create broken symlinks"
 
-ln -s "`pwd`/nonesuch" $lnk2
+ln -s "$(pwd)/nonesuch" $lnk2
 
 ln -s $lnk1 $lnka
 ln -s $lnka $lnkb
index 92ed26a9440fa460b1fb9ed0b93c015911f17f31..2fc9c93d15e4a19a421aad4c219a4effe1669c33 100755 (executable)
@@ -38,7 +38,9 @@ EOF
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 $MAKE install
 test -f 'inst/my/hello$world'
 $MAKE check-dist
+
+:
index 795f92226453e383a147204458004dadf9e8c121..23f8a7d59fb81f53ef7a9b5ffefd1383424ac547 100755 (executable)
@@ -25,5 +25,7 @@ echo 'data_DATA =' >Makefile.am
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 $MAKE install
+
+:
index 42fa57497d1c9e7c38cfddfef9f4fabe8d6f01ab..a07bdcb74515c269446b515068523e019be177df 100755 (executable)
@@ -62,7 +62,7 @@ grep '^maude\.static$(EXEEXT):' Makefile.in
 grep '^maude3$(EXEEXT):' Makefile.in
 grep '^mt$(EXEEXT):' Makefile.in
 grep '^rmt$(EXEEXT):' Makefile.in
-test `grep '^bin_PROGRAMS =' Makefile.in | wc -l` = 1
+test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
 
 # Make sure $(EXEEXT) gets stripped before canonicalization.
 grep 'maude3__EXEEXT__OBJECTS' Makefile.in && Exit 1
@@ -86,3 +86,5 @@ grep '1BEG: maude.foo :END1' stdout
 grep '2BEG: maude.static.foo :END2' stdout
 grep '3BEG: maude3.foo :END3' stdout
 grep '4BEG: :END4' stdout
+
+:
index 1bc1a10222a3bf66ee5a51017261ab658d8d2817..9561c7a2e3ec5f242d2f4f44fdf8e0ede851bf40 100755 (executable)
@@ -36,6 +36,8 @@ $ACLOCAL
 $AUTOMAKE -Wno-override
 
 $FGREP 'maude$(EXEEXT):' Makefile.in
-test 1 = `grep 'maude.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c 'maude.*:' Makefile.in)
 $FGREP '3dldf$(EXEEXT):' Makefile.in
-test 1 = `grep '3dldf.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c '3dldf.*:' Makefile.in)
+
+:
index d9099b6097d3cbb1c749bc5ddd6e2b8d55255416..693fc566e819f72d32863f58bf4037446ddb3302 100755 (executable)
@@ -64,7 +64,7 @@ $MAKE test-cond
 
 # Only two am__EXEEXT_* variables are needed here: one for BAR, and one
 # BAZ.  The latter must use the former.
-test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
+test 2 -eq $(grep -c '__EXEEXT_. =' Makefile.in)
 grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
 
 :
index c62dbd3aceef5129156b100d7d8604b16ef7e783..8d1d23870d693c70a49bab6882b4cdc83e46f323 100755 (executable)
--- a/t/ext.sh
+++ b/t/ext.sh
@@ -39,13 +39,10 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-for ext in f for f90 f95 F F90 F95 r m mm upc
-do
-   # Some versions of the BSD shell wrongly exit when 'set -e' is active
-   # if the last command within a compound statement fails and is guarded
-   # by an && only.  So we play safe and use the following idiom, instead
-   # of the apparently simpler 'grep ... && Exit 1'.
-   if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+for ext in f for f90 f95 F F90 F95 r m mm upc; do
    grep "^\.$ext\.o:" Makefile.in
+   grep "^$ext\.o:" Makefile.in && Exit 1
+   : For shells with busted 'set -e'.
 done
-Exit 0
+
+:
index 900b36bd3219534fd6349d40ffa872c21c85fbad..db7f3234cf450970608267685b576ee30b993fdb 100755 (executable)
--- a/t/fn99.sh
+++ b/t/fn99.sh
@@ -46,6 +46,6 @@ done) || skip_ "failed to create deeper directory hierarchy"
 $MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'filenames are too long' stderr
-test 2 = `grep 12345678 stderr | wc -l`
+test 2 -eq $(grep -c 12345678 stderr)
 
 :
index beb02618f74f53a671661c05a70fa881e16ca7be..0df282c0abe0fb3d68e66a31bf4c50ac4b21d416 100755 (executable)
@@ -76,6 +76,6 @@ done) || skip_ "failed to create deeper directory hierarchy"
 $MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
 cat stderr >&2
 grep 'filenames are too long' stderr
-test 1 = `grep 12345678 stderr | wc -l`
+test 1 -eq $(grep -c 12345678 stderr)
 
 :
index a23c9bda57d1e9269789f4af95fe4047a0d28378..7315ec1b4cde04770262825aa336251b9ec7f531 100755 (executable)
@@ -74,7 +74,7 @@ $AUTOCONF
 # or if the compiler cannot compile Fortran 90 files).
 ./configure
 $MAKE
-subobjs=`echo sub/*.o sub/*.obj`
+subobjs=$(echo sub/*.o sub/*.obj)
 test "$subobjs" = 'sub/*.o sub/*.obj'
 $MAKE distcheck
 
@@ -90,3 +90,5 @@ test ! -f baz.obj
 test ! -f goodbye-baz.o
 test ! -f goodbye-baz.obj
 $MAKE distcheck
+
+:
index 4614b661d1140360cf850c594f43ba305d0f079d..6fa1f22f6e606a0d1279420e29d1698ef369c474 100755 (executable)
@@ -89,7 +89,7 @@ grep " --tag=FC" Makefile.in
 # or if the compiler cannot compile Fortran 90 files).
 ./configure
 $MAKE
-subobjs=`echo sub/*.lo`
+subobjs=$(echo sub/*.lo)
 test "$subobjs" = 'sub/*.lo'
 $MAKE distcheck
 
@@ -103,3 +103,5 @@ test ! -f bar.lo
 test ! -f baz.lo
 test ! -f libgoodbye_la-baz.lo
 $MAKE distcheck
+
+:
index a8ec120b6f3237dd97ef53f6a44a1e776d4142a1..36692d9edbc15f621694e2baa52d6c8aec291a1b 100755 (executable)
--- a/t/gcj3.sh
+++ b/t/gcj3.sh
@@ -31,7 +31,6 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-num=`grep depcomp Makefile.in | wc -l`
-test $num -gt 1
+test $($FGREP -c depcomp Makefile.in) -gt 1
 
 :
index a860f89e200c06f2735690d0acd5bc41db196898..78d3fe7a5bd6eacbd8558c92c79d17c1800f209b 100755 (executable)
--- a/t/gcj4.sh
+++ b/t/gcj4.sh
@@ -32,7 +32,7 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
-./configure >stdout
+./configure >stdout || { cat stdout; Exit 1; }
 cat stdout
 
 # Configure must be checking the dependency style of gcj ...
@@ -40,7 +40,7 @@ grep 'dependency style of gcj' stdout >filt
 cat filt
 
 # ... only once.
-test `wc -l < filt` = 1
+test $(wc -l < filt) = 1
 
 # Accept any outcome but 'none'
 # (at the time of writing it should be gcc or gcc3).
index 416a8e50ffc26237f146e4f1138fa0d2c099ccfd..e424a8ec09760789993c6e30ec78136a34aca9c3 100755 (executable)
@@ -49,7 +49,7 @@ fi
 # in the AM_GNU_GETTEXT_VERSION call in configure.ac if we want autopoint
 # (or gettextize) to setup the correct infrastructure -- in particular,
 # for what concerns us, to bring in all the required .m4 files.
-autopoint_version=`extract_program_version $am_gettextize_command` \
+autopoint_version=$(extract_program_version $am_gettextize_command) \
   && test -n "$autopoint_version" \
   || autopoint_version=0.10.35
 
@@ -62,7 +62,7 @@ AM_GNU_GETTEXT_VERSION([$autopoint_version])
 END
 
 if $am_gettextize_command --force && test -f m4/gettext.m4; then
-  echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+  echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
   echo "export ACLOCAL_PATH" >> get.sh
 else
   # Older versions of gettext might not have a gettextize program
@@ -95,7 +95,7 @@ END
 
 # Remove any Makefile.in possibly created by gettextize/autopoint, to
 # avoid spurious maintainer-check failures.
-rm -f `find . -name Makefile.in`
+rm -f $(find . -name Makefile.in)
 
 # The file gettextize or autopoint might have copied in the 'm4'
 # subdirectory of the test directory are going to be needed by
index ef7078cc24e861e2d84338652b8b5d77266440d2..6bc9146095d0637f1ad0a964eb21a4a7c44af0e4 100755 (executable)
@@ -104,7 +104,7 @@ mkdir build
 cd build
 
 # Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
 $MAKE all
 $MAKE test-install
 $MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
index f4797629db6f30d6a9891924f05699fe3da80bb7..d8baf7c9785f736bd581ae0b23a7e14da71c9630 100755 (executable)
@@ -83,7 +83,7 @@ mkdir build
 cd build
 
 # Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
 $MAKE
 $MAKE install
 $MAKE installcheck && Exit 1
index 1e31cd2010b0185ffb39fcb7aef8a517365df96c..de868a841d660e300f8df09b65f32eda2fd1167f 100755 (executable)
@@ -31,8 +31,7 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-len=`grep '^srcdir' Makefile.in | wc -l`
-test $len -eq 1
+test $(grep -c '^srcdir' Makefile.in) -eq 1
 
 # Also make sure include file is distributed.
 sed -n -e '/^DIST_COMMON =.*\\$/ {
index d5fc34225525cc16d5dae421b6cf824b4b060251..2be4fefc06aadae54a81b89fa65e14b1cf4aab29 100755 (executable)
@@ -28,16 +28,14 @@ $ACLOCAL
 
 mv -f configure.ac configure.tmpl
 
-q="[\`'\"]"
-
 for args in '' '([])' '([yes])' '([no])'; do
   sed "s/AM_SILENT_RULES.*/&$args/" configure.tmpl >configure.ac
   cat configure.ac
   $AUTOCONF --force
   grep_configure_help --enable-silent-rules \
-                      " less verbose build.*\\(undo.*${q}make V=1${q}"
+                      ' less verbose build.*\(undo.*"make V=1".*\)'
   grep_configure_help --disable-silent-rules \
-                      " verbose build.*\\(undo.*${q}make V=0${q}"
+                      ' verbose build.*\(undo.*"make V=0".*\)'
 done
 
 :
index 9747968b17546d69549bfab1f4a08429dd5b0795..d51e0c41a7013628f37aef2f3f76a56dd8cf3bdb 100755 (executable)
@@ -29,7 +29,7 @@ ACLOCAL=$am_original_ACLOCAL
 AUTOMAKE=$am_original_AUTOMAKE
 
 escape_dots () { sed 's/\./\\./g'; } # Avoid issues with "\" in backquotes.
-apiversion_rx=`echo "$APIVERSION" | escape_dots`
+apiversion_rx=$(echo "$APIVERSION" | escape_dots)
 
 $ACLOCAL --version --help >stdout || { cat stdout; Exit 1; }
 cat stdout
index 738ddfd1c554e009f9e888cbe201fa8c52639e2e..b0b240fd5a8494d74cc6699e192c9ce9b5337638 100755 (executable)
--- a/t/info.sh
+++ b/t/info.sh
@@ -30,7 +30,7 @@ echo '@setfilename foo.info' > foo.texi
 $ACLOCAL
 $AUTOMAKE
 
-for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
+for i in $(grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'); do
    echo $i
    case "$i" in
     foo*)
index 12b22930ed27b04f699c25cf7750bfdf641d73b9..0b0521ba39a5c411ad23264f5e44b5abef5fb14c 100755 (executable)
@@ -24,7 +24,7 @@
 required=makeinfo
 . ./defs || Exit 1
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
 
 mkdir bin
 saved_PATH=$PATH; export saved_PATH
index dc83ee36d6ae0dc6e60d7213eb3ee49b94f50f2a..9b2bc5747f67df7224152758b2110d5672303142 100755 (executable)
@@ -36,9 +36,9 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-test `grep installdirs-local Makefile.in | wc -l` -eq 4
+test $(grep -c installdirs-local Makefile.in) -eq 4
 
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
 
 $AUTOCONF
 ./configure --prefix="$cwd/inst"
index 2965ff19d74e33867a80b5cd818772764b3c1308..abab752bf4a57771c6b47fa1fda4dc158eaf4a93 100755 (executable)
@@ -39,7 +39,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 $MAKE install
 test ! -d inst/share/instdir-cond
index 1fc24b70d8c618c799ec3b78b767d59998c3a9bc..6be0883c9f7c45a4cc5f703372391697e6fddc11 100755 (executable)
@@ -43,7 +43,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 $MAKE installdirs
 test ! -d inst || { find inst; Exit 1; }
index 4d47d19a8b40ff3c907df20dc1d0ae3d81d88bf9..83361d4709542bc244dd5dd390e350b947a9b635 100755 (executable)
@@ -37,8 +37,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index f019504d20050407e4b29b81149978233485ee9b..eebf5da18c9c6a993f49332ac8cacf7d636575f2 100755 (executable)
@@ -34,8 +34,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index ded16cd5be050da4d2b2eccc9ec2b7c424dd47c8..3d04d2c28bca5620a39413246098432c20cf402d 100755 (executable)
@@ -59,8 +59,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir" PYTHON="echo" \
index d93add8618281e7202fe91b548b29977fb111eea..f86365fe1c3413d8e747c43eeb00a9bbdb41990d 100755 (executable)
@@ -95,7 +95,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
 
 doinst ()
 {
index e0948c088cb5675e253714c4a699ef2ebc90c97b..d459f0ef55ec73c131e0cd2d6ce6dfc578e23c55 100755 (executable)
@@ -58,8 +58,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir" PYTHON="echo" \
index f48353deb5555c3a585833369eb587968ea95932..c15370e429698d39b131bb80ccfd7ab4ddfa417c 100755 (executable)
@@ -38,8 +38,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index 4e4887a7a865f00c0ad7e2a38c2f1cb5c0fc74fe..c0b660741778f33a95ce15640a3c67f35bed4b92 100755 (executable)
@@ -47,8 +47,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index f09fdfa7cae3a41384a824d71c37e07a9c1ef3f4..06821ed2378f89009f43252265b75907382b5356 100755 (executable)
@@ -47,8 +47,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index bdfa80999fc3ad06bf75b75bf2f1e4e20f5094fe..d12d39061902bc85ff0b84359c4e23f77ec120bd 100755 (executable)
@@ -69,8 +69,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
 mkdir build
 cd build
 ../configure --prefix="$instdir"
index 58aef975cd0970ad73b5e45a64c9323e5eaba62c..257f9a01304457b108223d6bba45fdffdc610fb4 100755 (executable)
@@ -45,7 +45,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
 ./configure --prefix="$instdir"
 $MAKE
 
index 0ae80f58ed5c6d461b1620ae69f1f4c3438dd742..b602517ea6c6656c4bacee506fe1806b9c832893 100755 (executable)
@@ -39,7 +39,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
 ./configure --prefix="$instdir"
 $MAKE
 
index 0acfd2c5acecc6109895127ab5b7a5281aea6fa2..b5a0d160e37663409cbac1316f3f096ad28a51bd 100755 (executable)
@@ -55,7 +55,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
 ./configure --prefix="$instdir"
 $MAKE
 
index 1e5a340f795b4f64a8548c0c81c77b34123fa81a..eb4c269ecc932d07f6006c86385dcd75d78622f8 100755 (executable)
@@ -60,7 +60,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
 ./configure --prefix="$instdir"
 $MAKE
 
@@ -83,9 +83,8 @@ $MAKE unreadable-progn
 $MAKE install-exec && Exit 1
 $MAKE readable-progn
 
-if grep "^EMACS = no" Makefile; then :; else
-  for file in lisp1.el lisp1.elc
-  do
+if ! grep "^EMACS = no" Makefile; then
+  for file in lisp1.el lisp1.elc; do
     chmod a-r $file
     $MAKE install-data && Exit 1
     chmod u+r $file
index 23bc4e03eaec18b067b04b8fcf12cefc291706ab..7fe0278c3ace2f2708706a177f3334a0e7e38efc 100755 (executable)
@@ -56,7 +56,7 @@ test -f ok
 # second version will overwrite 'foo'.  Hopefully 'install' and 'install-sh'
 # are smart enough to erase the 'foo' symlink before installing the new
 # version.)
-./configure "--bindir=`pwd`/bin"
+./configure "--bindir=$(pwd)/bin"
 $MAKE install
 echo 2 > foo
 VERSION=2.0 $MAKE -e install
index 78710459219faa09cd729bac2e36043399bfbcda..114dc71e9ec1daec5b84d566c0a981dcb38f1a67 100755 (executable)
@@ -30,5 +30,7 @@ EOF
 $ACLOCAL
 $AUTOMAKE
 
-grep '[^(/]MKDIR_P' Makefile.in > out
-test `wc -l < out` -eq 1
+grep 'MKDIR_P' Makefile.in # For debugging.
+test $(grep -c '[^(/]MKDIR_P' Makefile.in) -eq 1
+
+:
index ceb3a9e0f8cf74cb1ab0fcc3bdd0db4d371fd626..682fc1da7eadd723d50ff048c29c3c29c417911d 100755 (executable)
@@ -28,7 +28,7 @@
 limit=2500
 subdir=long_subdir_name_with_many_characters
 nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
 
 sed "s|@limit@|$limit|g" >myinstall.in <<'END'
 #! /bin/sh
@@ -100,7 +100,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
@@ -110,11 +110,11 @@ $MAKE install
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
index d0c5b1a95dd45e71eb7c08e67151236d47b16eb8..d6dd1189510075346757c71e57593d2007b397aa 100755 (executable)
@@ -24,7 +24,7 @@ required='python'
 limit=2500
 subdir=long_subdir_name_with_many_characters
 nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
 
 sed "s|@limit@|$limit|g" >myinstall.in <<'END'
 #! /bin/sh
@@ -91,7 +91,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
@@ -101,11 +101,11 @@ $MAKE install
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
index d334ebef1b968b646178ac802d175c1e5e35095e..7721f7df76eb9cf604b4d97b16d18009b3d2f51c 100755 (executable)
@@ -36,7 +36,7 @@
 limit=2500
 subdir=long_subdir_name_with_many_characters
 nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
 
 sed "s|@limit@|$limit|g" >myinstall.in <<'END'
 #! /bin/sh
@@ -114,7 +114,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
 mkdir build
 cd build
 ../configure --prefix="$instdir"
@@ -124,11 +124,11 @@ $MAKE install
 # Multiple uninstall should work, too.
 $MAKE uninstall
 $MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
 
 # Try whether we don't exceed the low limit.
 INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
 
 cd $subdir
 srcdir=../../$subdir
index cbe0fdfdd9bd4ac9c38938f40f9db6c1a4c7b998..a6f776376baf87e1d8e683bbb4521d9ce68b19ea 100755 (executable)
@@ -219,8 +219,8 @@ if test $# -gt 0; then
     esac
   done
   # We need to determine the TAP plan adaptively.
-  n=`for t in $test_names_list; do echo $t; done | wc -l`
-  plan_ `expr $n '*' 2` # Two tests per "problematic string".
+  n=$(for t in $test_names_list; do echo $t; done | wc -l)
+  plan_ $(($n * 2)) # Two tests per "problematic string".
   unset n
 else
   test_names_list=$all_test_names_list
@@ -228,7 +228,7 @@ else
   plan_ 94
 fi
 
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 create_input_data
 
@@ -324,10 +324,10 @@ for test_name in $test_names_list; do
     # the test directory not to be removed when the script terminates.
     if not am_keeping_testdirs && test "$r" = ok; then
       rm_rf_ "$build" "$dest" || fatal_ "removing temporary subdirectory"
-    else
-      : For lesser shells with broken 'set -e'.
     fi
 
+    : For shells with busted 'set -e'.
+
   done # $instspc_action
 
 done # $test_name
index 230fb96f13e984c060180c5fd9b8971ea76ba6b3..15c0e457b218278236269a86e8925bf219471a84 100755 (executable)
@@ -41,7 +41,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-inst=`pwd`/_inst
+inst=$(pwd)/_inst
 
 ./configure --prefix="$inst"
 
index f3340ffa3733294a0ef53b6e58bcaee9eaaeca71..448a839076c0d37617e1653a6785ba24f7c20c38 100755 (executable)
@@ -87,7 +87,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
 $MAKE
 $MAKE test
 $MAKE install
index 9f3c184416ac28e7b786bb59f4d97b63ff36c08d..94a6fa90b9f512ee05cc6e340df2c394ea2e9b08 100755 (executable)
@@ -230,7 +230,7 @@ $AUTOMAKE
 # To have the parallel testsuite more verbose.
 VERBOSE=yes; export VERBOSE
 
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
 cat PkgLocation.java # For debugging.
 $MAKE check
 $MAKE install
index 61727f7c900f9f6e352512ff559c402e344d52de..c1c79422cc969acdec893d7e7e9ee87ad8e00762 100755 (executable)
@@ -239,7 +239,7 @@ $AUTOMAKE -a
 # To have the parallel testsuite more verbose.
 VERBOSE=yes; export VERBOSE
 
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
 cat jprog/PkgLocation.java # For debugging.
 $MAKE check
 $MAKE install
index 416fdb9c7d541f8e1b32232abfd4dcfd2975f21a..d7ea5f29f90d022172118e8fd003688a898f4c98 100755 (executable)
@@ -36,10 +36,10 @@ $EGREP -i '\.stamp|\.class|java|classpath' Makefile.in # For debugging.
 
 for var in JAVAC JAVAROOT CLASSPATH_ENV am__java_sources; do
   grep "^$var =" Makefile.in
-  test `grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in` = 1
+  test $(grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in) -eq 1
 done
 
 grep '^classjava\.stamp:' Makefile.in
-test `grep -c "class.*java.*\.stamp.*:" Makefile.in` = 1
+test $(grep -c "class.*java.*\.stamp.*:" Makefile.in) -eq 1
 
 :
index ff72a13387d7a861085ef25f916703bb762fdb32..7a1ca440d5cd1193bf9f7f148c4551e5c61a3e94 100755 (executable)
@@ -56,7 +56,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
 $MAKE check
 $MAKE install
 $MAKE test-install
index b11e6a0000cdfa7b8dc3632c9079ba4d620d371b..cf0c600587dc67b74ddc1d8a75dee1e95e288eed 100755 (executable)
@@ -41,7 +41,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
 
 $MAKE
 ls -l
index fb6bfa1beef9a214933740e1d0201ec27a230e5a..e637f6a6a0488e454130e26e6f3a594180327887 100755 (executable)
@@ -56,7 +56,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
 javadir=_inst/java
 
 check_uninstallation()
index 16b1250389f287d916434e57baeba1e75af3b39e..8ba2dc15c74f47fefe4633022c8f5df45efa1893 100755 (executable)
--- a/t/java.sh
+++ b/t/java.sh
@@ -34,19 +34,12 @@ $AUTOMAKE
 
 $EGREP '\.stamp|class' Makefile.in # For debugging.
 grep '^all[-a-z]*:.*classjava\.stamp' Makefile.in
-test `grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in` -eq 1
+test $(grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in) -eq 1
 
-cat >a.java <<EOF
-class a
-{
-}
-EOF
-
-cat >b.java <<EOF
-class b
-{
-}
-EOF
+echo 'class a { }' > a.java
+echo 'class b { }' > b.java
 
-./configure --prefix "`pwd`"
+./configure
 $MAKE distcheck
+
+:
index 7d94635993b70a23ebee49c53c3c2db6c89bf9e6..356d0c2004c7044998436019c6bd5f4cc5c0ccbe 100755 (executable)
@@ -42,8 +42,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-cwd=`pwd` || Exit 1
-./configure --prefix="$cwd/_inst"
+./configure --prefix="$(pwd)/_inst"
 $MAKE
 $MAKE install
 ls -l .
index 21802c5d2b9670f8d345c6bb6280ace4ca941581..df8aa00b289ea95a2aaca1c1cafd749a16af2adf 100755 (executable)
@@ -69,7 +69,7 @@ $MAKE have-lexlib || skip_ "no system-wide lex library found"
 
 # Program should build and run and distribute.
 $MAKE all
-if cross_compiling; then :; else
+if ! cross_compiling; then
   echo GOOD | ./lexer
   echo BAD | ./lexer && Exit 1
   : For shells with busted 'set -e'.
index 1c4a13b1975ea7268df834e6c45a1b3b6b12a0da..733527915ce38eace255992b3fdcf54752903386 100755 (executable)
@@ -63,7 +63,7 @@ $AUTOMAKE -a
 
 # Program should build and run.
 $MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
   echo GOOD | ./foo
   echo BAD | ./foo && Exit 1
   : For shells with busted 'set -e'.
index 3ebb57260884fae12bb7add6af306a437c97f264..c12113fead7e696ca5fba76bae6eac78a343a6d5 100755 (executable)
@@ -83,7 +83,7 @@ touch lexer.l lexer2.l
 $sleep
 $MAKE lexer.c lexer2.c
 stat lexer.c lexer.l lexer2.c lexer2.l || : # For debugging.
-test `ls -t lexer.c lexer.l | sed 1q` = lexer.c
-test `ls -t lexer2.c lexer2.l | sed 1q` = lexer2.c
+test $(ls -t lexer.c lexer.l | sed 1q) = lexer.c
+test $(ls -t lexer2.c lexer2.l | sed 1q) = lexer2.c
 
 :
index 125152b44aa6a1812dbd3f4715cff9b79976f9cc..78cf11c63a55afa08c8ef32ce25b71b7efe710da 100755 (executable)
--- a/t/lex3.sh
+++ b/t/lex3.sh
@@ -66,7 +66,7 @@ $AUTOMAKE -a
 
 # Program should build and run.
 $MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
   echo GOOD | ./foo
   echo BAD | ./foo && Exit 1
   : For shells with busted 'set -e'.
index 27a2b156f2e482f23d2435689662852b570f7061..daf96b9223bf728028e901b129071faec8e17ebd 100755 (executable)
@@ -49,4 +49,6 @@ $ACLOCAL
 AUTOMAKE_fails
 grep '^Makefile.am:.*:   !A and !C and !D$' stderr
 # Is there only one missing condition?
-test `grep ':   !' stderr | wc -l` = 1 || Exit 1
+test $(grep -c ':   !' stderr) -eq 1
+
+:
index e5c77ac1d03ac92d46807ccf00554b8d45ccf4f9..f2f881128a219c3f682ecf617c1c5b181cb3335b 100755 (executable)
@@ -27,7 +27,7 @@ echo : >> get.sh
 echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
 
 if libtoolize --copy --install && test -f m4/libtool.m4; then
-  echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+  echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
   echo "export ACLOCAL_PATH" >> get.sh
 else
   # Libtoolize from libtool < 2.0 didn't support the '--install' option,
index 13dbc738e29f4030f7d897c60d84d049762d0bab..7655569d93bf68f0238d1e0fbebb6a5f764a3e94 100755 (executable)
@@ -42,4 +42,6 @@ libtoolize
 $ACLOCAL
 $AUTOMAKE --add-missing
 # am_liba_la_rpath is defined twice, and used once
-test 3 = `grep 'am_liba_la_rpath' Makefile.in | wc -l`
+test 3 -eq $(grep -c 'am_liba_la_rpath' Makefile.in)
+
+:
index bc8eacae38028716915e142a3d4f743f9683ae95..6dc6aeb9fa3a63a06491c37ffd1e95459b5221b7 100755 (executable)
@@ -78,7 +78,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing --copy
 
-./configure "--prefix=`pwd`/_inst"
+./configure "--prefix=$(pwd)/_inst"
 env LIBTOOLFLAGS=--silent $MAKE print >output 2>&1 || {
   cat output
   Exit 1
@@ -87,7 +87,7 @@ cat output
 grep '1BEG: libmod1.la mod2.la :END1' output
 grep '2BEG: mod2.la :END2' output
 grep '3BEG: .*silent.*silent.* :END3' output
-test 2 -le `grep mod2_la_LIBTOOLFLAGS Makefile | wc -l`
+test 2 -le $(grep mod2_la_LIBTOOLFLAGS Makefile | wc -l)
 $MAKE
 
 env LIBTOOLFLAGS=--silent $MAKE install >output 2>&1 || {
index a1531d355f98e52e74acc01e6e3340ba33bf2b05..0d8be77bb316bb5184236f90237d1660fc1fa6a7 100755 (executable)
@@ -40,7 +40,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
 
 $MAKE
 
index 8d2de591a33c4ebceb2f78d6730c3c52fb673752..82109f5b4fa55942edd27e99c2714a3200a71214 100755 (executable)
@@ -60,7 +60,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
 $MAKE
 $MAKE test
 $MAKE install-test
@@ -70,7 +72,7 @@ $MAKE not-installed
 # Fake the absence of emacs.
 # *.el files should not be installed, but "make install" and
 # "make uninstall" should continue to work.
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
 $MAKE
 $MAKE test
 $MAKE install
index 997a56e739cbdc4a934d289315831fc9a4130f9e..34edf3b57045ef88620dedd9b52239ee5c2cc389 100755 (executable)
@@ -59,7 +59,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
 $MAKE
 $MAKE test
 $MAKE install-test
@@ -69,7 +71,7 @@ $MAKE not-installed
 # Fake the absence of emacs.
 # *.el files SHOULD be installed by "make install" (and uninstalled
 # by "make uninstall").
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
 $MAKE
 $MAKE test
 $MAKE install-test
index 9635ea2756c165decfa774a7aa81d52b1aaea17d..1e3bc4186e090e4bc5055fbc94c50b670be5cdf3 100755 (executable)
@@ -38,6 +38,9 @@ AM_PATH_LISPDIR
 AC_OUTPUT
 EOF
 
+# Avoid possible spurious influences from the environment.
+want_two=; unset want_two
+
 echo "(provide 'am-one)" > am-one.el
 echo "(require 'am-one)" > am-two.el
 echo "(require 'am-one)" > am-three.el
@@ -46,7 +49,9 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure "--with-lispdir=`pwd`/lisp"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --with-lispdir="$cwd/lisp"
 
 $MAKE
 test -f am-one.elc
@@ -70,7 +75,7 @@ test ! -f am-two.elc
 test ! -f am-three.elc
 test ! -f elc-stamp
 
-./configure "--with-lispdir=`pwd`/lisp" want_two=1
+./configure --with-lispdir="$cwd/lisp" want_two=1
 
 $MAKE
 test -f am-one.elc
index 79799d160957fc6ecb86a9f86ff632c722c8f43c..6022334fc2b80ab932ff11a232780a256f3cf36f 100755 (executable)
@@ -39,7 +39,7 @@ $AUTOMAKE --add-missing
 
 $MAKE >stdout || { cat stdout; Exit 1; }
 cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 
 test ! -f am-one.elc
 test ! -f am-two.elc
index 738cbd6ecad07a873eff6925bd4e40faa49a420c..8c1982bd94c7bd2a51a1397664d2dba4d412259e 100755 (executable)
@@ -42,7 +42,7 @@ $AUTOMAKE --add-missing
 $MAKE -j >>stdout || { cat stdout; Exit 1; }
 
 cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 
 test -f am-one.elc
 test -f am-two.elc
@@ -56,7 +56,7 @@ rm -f am-*.elc
 $MAKE -j >>stdout || { cat stdout; Exit 1; }
 
 cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
 test -f am-one.elc
 test -f am-two.elc
 test -f am-three.elc
index 1ba8072f38fa682a8f44d4d496010c67b3699674..ab3d5d4ce7c74e58b65945f0b69dad787d35676e 100755 (executable)
 
 . ./defs || Exit 1
 
-n=1
-files=
-match=
+n=1 files= match=
 while test $n -le 100
 do
   files="$files filename$n"
   match="..........$match"
-  n=`expr $n + 1`
+  n=$(($n + 1))
 done
-files2=`echo "$files" | sed s/filename/filenameb/g`
+files2=$(echo "$files" | sed s/filename/filenameb/g)
 
 cat >Makefile.am <<EOF
 FOO = $files $files2 \
@@ -46,3 +44,5 @@ $AUTOMAKE
 
 grep $match Makefile.in && Exit 1
 grep 'filenameb100 grepme' Makefile.in
+
+:
index dd5664d310546a1650ec5ff4404be16e7cf0fec1..0c7e09e820b428de6e84cbfb587dddb162d433cf 100755 (executable)
@@ -27,4 +27,6 @@ done) > Makefile.am
 
 $ACLOCAL
 $AUTOMAKE
-test 80 -ge `grep DUMMY Makefile.in | wc -c`
+test 80 -ge $(grep DUMMY Makefile.in | wc -c)
+
+:
index d5098ea9be70d126b34c5b28754e26f4f6315689..7562d92bd09c49943cdd46a225f6ec4a46fc5293 100755 (executable)
@@ -61,10 +61,12 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
+cwd=$(pwd) || fatal_ "getting current working directory"
+
 # Install libraries in lib/, and the rest in empty/.
 # (in fact there is no "rest", so as the name imply empty/ is
 # expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib"
 
 $MAKE
 test -f lib1foo.la
@@ -85,12 +87,11 @@ test -f lib/lib1bar.la
 test -f lib/lib2foo.la
 test ! -f lib/lib3foo.la
 find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
 
 $MAKE uninstall
 find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
+test -s lib.lst && { cat lib.lst; Exit 1; }
 test -f lib1foo.la
 test -f lib1bar.la
 test -f lib2foo.la
index 19ed8b34b5079e5f3e581d7dd00b9e0ab67c8714..7a6258575ec0a9bf1a03a23fef22ba5374928ed4 100755 (executable)
@@ -110,10 +110,12 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
+cwd=$(pwd) || fatal_ "getting current working directory"
+
 # Install libraries in lib/, programs in bin/, and the rest in empty/.
 # (in fact there is no "rest", so as the name imply empty/ is
 # expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib" "--bindir=`pwd`/bin"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib" --bindir="$cwd/bin"
 
 $MAKE
 test -f libtop.la
@@ -132,8 +134,7 @@ test -f installcheck-ok
 rm -f installcheck-ok
 
 find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
 
 $MAKE clean
 test ! -f libtop.la
@@ -148,9 +149,10 @@ test -f installcheck-ok
 rm -f installcheck-ok
 
 $MAKE uninstall
-find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
-find bin -type f -print > bin.lst
-test 0 = `wc -l < bin.lst`
+for d in lib bin; do
+  find $d -type f -print > $d.lst
+  test -s $d.lst && { cat $d.lst; Exit 1; }
+  : For shells with busted 'set -e'.
+done
 
 :
index 49ddbe0f817d227a77df074baf5bfb2ced9a346f..e0f9b02adb047f54c7dd84d3230c819e51df5247 100755 (executable)
@@ -55,8 +55,7 @@ libtoolize
 $EGREP 'LT_(INIT|PREREQ)' configure && Exit 1 # Sanity check.
 $AUTOMAKE -a
 
-cwd=`pwd`
-./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
+./configure --prefix="$(pwd)/inst" >stdout || { cat stdout; Exit 1; }
 cat stdout
 grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout
 
index 358e620fe43a66c78fad2f6da82b4293ebc64fab..59047a0a6dc2114e2c4c416871680322daacb318 100755 (executable)
@@ -49,7 +49,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 $MAKE
 $MAKE install 2>stderr || { cat stderr >&2; Exit 1; }
@@ -57,6 +57,6 @@ cat stderr >&2
 grep 'has not been installed' stderr && Exit 1
 
 $MAKE uninstall
-test `find inst -type f -print | wc -l` -eq 0
+test $(find inst -type f -print | wc -l) -eq 0
 
 :
index 8a7c4510407fae83f5a1569eeeacc3e19d76fd00..5396cbf3514b429b9bf8409bb1a3d5a7f1cf357d 100755 (executable)
@@ -37,8 +37,7 @@ check_configure_message_with ()
   ./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; }
   cat stdout
   grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
-  test `grep -c 'checking.*maint' stdout` -eq 1
-  :
+  test $(grep -c 'checking.*maint' stdout) -eq 1
 }
 
 set_maintmode "DEFAULT"
index 2172124b50dca1e024287219fa9660afaca150cc..8e25d88f874d2504cf2f822736526f00ce692ccb 100755 (executable)
@@ -53,7 +53,7 @@ $AUTOMAKE   || fatal_ "automake failed"
 check_no_dryrun ()
 {
   command_ok_ "dry-run ($cnt)" $MAKE notdry ${1+"$@"}
-  cnt=`expr $cnt + 1`
+  cnt=$(($cnt + 1))
 }
 cnt=1
 
@@ -86,7 +86,7 @@ check_dryrun ()
   fi
   result_ "$r" -D "$directive" -r "$reason" "not dry-run ($cnt)"
   unset r directive reason
-  cnt=`expr $cnt + 1`
+  cnt=$(($cnt + 1))
 }
 cnt=1
 
@@ -108,7 +108,7 @@ check_metachars ()
   fi
   result_ "$r" "dry-run, with shell metachars ($cnt)"
   unset r
-  cnt=`expr $cnt + 1`
+  cnt=$(($cnt + 1))
 }
 cnt=1
 
index 8183887a44a6ba790e0987654ea57be634773670..2e5d55b94c7dab45c61a7ed597453a609843ee68 100755 (executable)
@@ -35,10 +35,10 @@ $AUTOMAKE
 
 mkdir build
 cd build
-../configure "--prefix=`pwd`/inst"
+../configure --prefix="$(pwd)/inst"
 
 $MAKE -j2 || skip_ "$MAKE failed to run with two parallel jobs"
 $MAKE -j2 distcheck
 $MAKE test-distdir-removed
 
-Exit 0
+:
index bb644446173808908e30faebf04290b399e26653..86c40c3a5ad7e16cb296b03d24c8b3204a555b19 100755 (executable)
@@ -56,7 +56,7 @@ for target in dist distcheck; do
     $MAKE -n $target | grep stamp-sub-dist-hook || Exit 1
   fi
   $MAKE test-no-distdir
-  test `ls -1t | sed 1q` = stampfile
+  test $(ls -1t | sed 1q) = stampfile
 done
 
-Exit 0
+:
index 38c399288c7177a8d77be57dfd0d7efa0393dc85..7a1c5d74786426a0f7d1cc0dcce58bc3d50b4037 100755 (executable)
--- a/t/man2.sh
+++ b/t/man2.sh
@@ -36,15 +36,17 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
+cwd=$(pwd) || fatal_ "getting current working directory"
+
 # Let's play with $DESTDIR too, it shouldn't hurt.
 ./configure --prefix='' --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
 
 test -f ./_inst/man/man2/foo.2
 test -f ./_inst/man/man4/foo.4
 test -f ./_inst/man/man4/bar.4
 
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
 
 test ! -f ./_inst/man/man2/foo.2
 test ! -f ./_inst/man/man4/foo.4
index c7333b9c2fd47cb3b36bfd0715ff9be76f872dcb..c8fd86d6e9bb60ff89b184421fbfff7a7f340708 100755 (executable)
--- a/t/man4.sh
+++ b/t/man4.sh
@@ -67,7 +67,7 @@ cat > bin/help2man <<'END'
 exit 127
 END
 chmod +x bin/help2man
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
 
 grep_error_messages()
 {
index 674ea03c1864b56eed2c8e6cdd2b2cf9eb6678a5..89f254556d2eaeabb7e09e6d8fd08323aa1c94b1 100755 (executable)
--- a/t/man5.sh
+++ b/t/man5.sh
@@ -40,28 +40,30 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
+cwd=$(pwd) || fatal_ "getting current working directory"
+
 # Let's play with $DESTDIR too, it shouldn't hurt.
 ./configure --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
 
-test -f ./_inst/man/man2/foo.2
-test -f ./_inst/man/man2/nfoo.2
-test -f ./_inst/man/man2/baz-1.4.2
-test -f ./_inst/man/man2/nbaz-1.4.2
-test -f ./_inst/man/man3/bar.3
-test -f ./_inst/man/man3/nbar.3
+test -f _inst/man/man2/foo.2
+test -f _inst/man/man2/nfoo.2
+test -f _inst/man/man2/baz-1.4.2
+test -f _inst/man/man2/nbaz-1.4.2
+test -f _inst/man/man3/bar.3
+test -f _inst/man/man3/nbar.3
 
-test ! -d ./_inst/man/man1
-test ! -d ./_inst/man/man4
-test ! -d ./_inst/man/man5
+test ! -d _inst/man/man1
+test ! -d _inst/man/man4
+test ! -d _inst/man/man5
 
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
 
-test ! -f ./_inst/man/man2/foo.2
-test ! -f ./_inst/man/man2/nfoo.2
-test ! -f ./_inst/man/man2/baz-1.4.2
-test ! -f ./_inst/man/man2/nbaz-1.4.2
-test ! -f ./_inst/man/man3/bar.3
-test ! -f ./_inst/man/man3/nbar.3
+test ! -f _inst/man/man2/foo.2
+test ! -f _inst/man/man2/nfoo.2
+test ! -f _inst/man/man2/baz-1.4.2
+test ! -f _inst/man/man2/nbaz-1.4.2
+test ! -f _inst/man/man3/bar.3
+test ! -f _inst/man/man3/nbar.3
 
 :
index 4cef9526dcb523283b3d06cdcd80730d10743263..66afac1bce847f5df1cc01c906f853eb34bcf285 100755 (executable)
@@ -21,7 +21,7 @@ am_create_testdir=empty
 
 get_shell_script mdate-sh
 
-set x `./mdate-sh mdate-sh`
+set x $(./mdate-sh mdate-sh)
 shift
 echo "$*" # For debugging.
 
@@ -38,7 +38,7 @@ case $2 in
 esac
 
 # Stricter checks on the year required a POSIX date(1) command.
-if year=`date +%Y` && test $year -gt 2010; then
+if year=$(date +%Y) && test $year -gt 2010; then
   test $year = $3 || Exit 1
 fi
 
index 80bba36916ceccb2e65406b451d5735eb0e288f6..363cc1aab7653aea05d240789e8da30347ca2e3e 100755 (executable)
@@ -24,7 +24,7 @@ get_shell_script missing
 
 # These programs may be invoked by 'missing'.
 needed_tools='chmod find sed test touch'
-needed_tools_csep=`echo $needed_tools | sed 's/ /, /g'`
+needed_tools_csep=$(echo $needed_tools | sed 's/ /, /g')
 
 cat >configure.ac <<EOF
 AC_INIT([missing4], [1.0])
index 658283600db2b4214b6fa1ca006f1a1149b5fb2a..2a4fb0b0c364ddd06e8c2bde2904f2bd7b8e6829 100755 (executable)
@@ -30,7 +30,11 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
-./configure --prefix "`pwd`/sub"
+./configure --prefix "$(pwd)/sub"
 
 $MAKE installdirs
 test ! -d sub/man
+$MAKE install
+test ! -d sub/man
+
+:
index fbe01c652a2d96847ed2a09cc42a1b3c7fe02cfc..08cfb76e8558a814d808aae29e3dce4ac7a9a365 100755 (executable)
@@ -19,6 +19,8 @@
 am_create_testdir=empty
 . ./defs || Exit 1
 
+cwd=$(pwd) || fatal_ "getting current working directory"
+
 # Make sure the directory we will create can be created...
 mkdir '~a b' && mkdir '~a b/-x  y' \
   || skip_ "directory names with spaces and metacharacters not accepted"
@@ -49,10 +51,9 @@ exec mkdir "$@"
 EOF
 
 chmod +x bin/mkdir
-AM_PATH=$PATH
-export AM_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
-export PATH
+
+AM_PATH=$PATH; export AM_PATH
+PATH=$cwd/bin$PATH_SEPARATOR$PATH; export PATH
 
 # Test mkinstalldirs without mkdir -p.
 
@@ -60,6 +61,8 @@ export PATH
 test -d '~a b/-x  y'
 rm -rf '~a b'
 
-./mkinstalldirs "`pwd`///~a b//-x  y"
-test -d "`pwd`/~a b/-x  y"
+./mkinstalldirs "$cwd///~a b//-x  y"
+test -d "$cwd/~a b/-x  y"
 rm -rf '~a b'
+
+:
index 6c6191520bc5d6aad6025487839ac1a8e150cbd7..25139aa889682197ca6392c8bd1d326d047a6791 100755 (executable)
@@ -81,7 +81,7 @@ cat >mylex.sh <<'END'
 echo "$@" >lex.yy.c
 END
 chmod +x myyacc.sh mylex.sh
-PATH="`pwd`$PATH_SEPARATOR$PATH"
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
 
 # "make maintainer-clean; ./configure; make" should always work,
 # per GNU Standard.
@@ -89,5 +89,7 @@ $MAKE maintainer-clean
 ./configure
 YACC="myyacc.sh" LEX="mylex.sh" \
    LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
-grep zardoz.y zardoz.c
-grep joe.l joe.c
+$FGREP zardoz.y zardoz.c
+$FGREP joe.l joe.c
+
+:
index 0295ccc4578a2aa923cb319f3544037d6211e39a..698f1c0bd31a80ce2115c471696eb3f4e3399424 100755 (executable)
@@ -27,7 +27,7 @@ mkdir m4
 cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
 cp "$mldir"/multi.m4 m4
 
-ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}`pwd`/m4
+ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
 export ACLOCAL_PATH
 
 cat >configure.ac <<'END'
@@ -53,7 +53,7 @@ gcc ${1+"$@"}
 END
 
 chmod +x mycc
-PATH=`pwd`$PATH_SEPARATOR$PATH
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
 
 cat >Makefile.am <<'EOF'
 SUBDIRS = @subdirs@
index 38008cd0af873326515010805ddedbd704158893..163ffd36ff41cf88371855a5cffbe85c973d8d93 100755 (executable)
@@ -54,8 +54,7 @@ EOF
 mkdir sub
 
 cat >source.c <<'EOF'
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
 {
   return 0;
 }
@@ -68,14 +67,14 @@ libtoolize
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
 
 $MAKE
 $MAKE test-install-data
 $MAKE test-install-exec
 $MAKE uninstall
 
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
 $MAKE install-strip
 
@@ -85,11 +84,11 @@ $MAKE uninstall
 $MAKE distclean
 mkdir build
 cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
 $MAKE
 $MAKE test-install-data
 $MAKE test-install-exec
 $MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
 :
index 28509018b6d47aae13f04405f74decaaa8385f0c..d086bbe438e09f53c32c2a6da1015c20614ed3ab 100755 (executable)
@@ -45,8 +45,7 @@ END
 
 mkdir sub
 
-for file in one.py sub/base.py two.py sub/nobase.py
-do
+for file in one.py sub/base.py two.py sub/nobase.py; do
   echo 'def one(): return 1' >$file
 done
 
@@ -54,7 +53,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
 
 $MAKE
 $MAKE test-install-data
@@ -70,7 +69,7 @@ $MAKE uninstall
 $MAKE distclean
 mkdir build
 cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
 $MAKE
 $MAKE test-install-data
 $MAKE uninstall
index e7661c09a426b2a31ff92696247a40abc796aec9..a7219ed457d0b9eec326b3323e2fe81939ec64f9 100755 (executable)
@@ -120,14 +120,14 @@ rm -f install-sh
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
 
 $MAKE
 $MAKE test-install-data
 $MAKE test-install-exec
 $MAKE uninstall
 
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
 $MAKE install-strip
 
@@ -137,11 +137,11 @@ $MAKE uninstall
 $MAKE distclean
 mkdir build
 cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
 $MAKE
 $MAKE test-install-data
 $MAKE test-install-exec
 $MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
 :
index 36851be9011bce7b3f7b8f41b26d624ac5ef57c2..9c7ec30e35ab0cb6d3e9fd3b82fa2f2a56882636 100755 (executable)
@@ -32,7 +32,7 @@ EOF
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
-./configure --prefix "`pwd`/install"
+./configure --prefix "$(pwd)/install"
 $MAKE install-data
 
 :
index 487b66f3def50da60b210ce2cabdd5e8beee77bc..81ed4d89dcba9e7a655da17c5cb392c74e79e7f3 100755 (executable)
@@ -79,8 +79,8 @@ test-install: install
        test -f inst/man/man2/z-bar2.2
        test -f inst/man/man1/z-baz.1
        test -f inst/man/man1/z-baz2.1
-       if test -d inst/man/man8; then (exit 1); else :; fi
-       if test -d inst/man/man9; then (exit 1); else :; fi
+       test ! -d inst/man/man8
+       test ! -d inst/man/man9
 EOF
 
 : > foo.1
@@ -106,16 +106,18 @@ grep '^install-man3:' Makefile.in | grep '\$(nodist_man_MANS)'
 grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
 grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
 grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
+grep '^install-man8:' Makefile.in && Exit 1
+grep '^install-man9:' Makefile.in && Exit 1
 
-if grep '^install-man8:' Makefile.in; then Exit 1; else :; fi
-if grep '^install-man9:' Makefile.in; then Exit 1; else :; fi
+cwd=$(pwd) || fatal_ "getting current working directory"
 
-./configure --program-prefix=gnu- --prefix "`pwd`"/inst --mandir "`pwd`"/inst/man
+./configure --program-prefix=gnu- --prefix "$cwd"/inst \
+                                  --mandir "$cwd"/inst/man
 $MAKE
 $MAKE test-install
-test `find inst/man -type f -print | wc -l` = 24
+test $(find inst/man -type f -print | wc -l) -eq 24
 $MAKE uninstall
-test `find inst/man -type f -print | wc -l` = 0
+test $(find inst/man -type f -print | wc -l) -eq 0
 
 # Opportunistically test for installdirs.
 rm -rf inst
@@ -127,5 +129,7 @@ test -d inst/man/man4
 test -d inst/man/man5
 test -d inst/man/man6
 test -d inst/man/man7
-if test -d inst/man/man8; then Exit 1; else :; fi
-if test -d inst/man/man9; then Exit 1; else :; fi
+test -d inst/man/man8 && Exit 1
+test -d inst/man/man9 && Exit 1
+
+:
index b96e1180dba47e39b4db563e28398227f635b581..d5c3acf0e5ee5c0a1c08408d4a62b24ed40d3590 100755 (executable)
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure _OBJECTS only generated once.  Bug reported by
+# Test to make sure _OBJECTS is only generated once.  Bug reported by
 # Joerg-Martin Schwarz.
 
 . ./defs || Exit 1
@@ -31,7 +31,6 @@ $ACLOCAL
 $AUTOMAKE
 
 grep '^zardoz_OBJECTS' Makefile.in
-count=`grep -c '^zardoz_OBJECTS' Makefile.in`
-test $count -eq 1
+test $(grep -c '^zardoz_OBJECTS' Makefile.in) -eq 1
 
 :
index 3a0977d8b13f4193169c261ec4505d5ad108e170..8a26db78f444bea158e9d78d5dec9b6246d23870 100755 (executable)
@@ -330,7 +330,7 @@ END
 ./configure
 $MAKE
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   unindent > exp << 'END'
     [Hello C, world C]
     [Hello C++, world C++]
index 2fe2dfd2cd52bd5b4aa258a07f1031aa99f6748e..440fc1d199e8e3e2974584980f465ef2ab52e22b 100755 (executable)
@@ -52,7 +52,7 @@ touch foo.lisp mu1.lisp mu2.lisp
 $MAKE all
 cat foo
 cat zardoz
-test "`cat foo`"    = "Linked foo from foo.fasl"
-test "`cat zardoz`" = "Linked zardoz from mu1.fasl mu2.fasl"
+test "$(cat foo)"    = "Linked foo from foo.fasl"
+test "$(cat zardoz)" = "Linked zardoz from mu1.fasl mu2.fasl"
 
 :
index c4240c200f2f82398a58bbe84bcec1002c4b57fc..e48d435ead3e9a127eac49a26c529ce10c7286de 100755 (executable)
@@ -39,7 +39,7 @@ cat obs.1        # Likewise.
 cat obs.2        # Likewise.
 
 # Sanity check.  Make sure we have added something to configure.ac.
-test `wc -l <configure.ac` -gt 1
+test $(wc -l <configure.ac) -gt 1
 
 $ACLOCAL
 
index 87d9cf1fad47531df91d8d4625c978123d38e813..dd162fff85f2f237ca377dd13a27045825c7d1e5 100755 (executable)
@@ -32,4 +32,6 @@ EOF
 
 $ACLOCAL
 AUTOMAKE_fails
-test `grep -c anachronism stderr` -eq 8
+test $(grep -c anachronism stderr) -eq 8
+
+:
index 1339c67dd29afa36ceff23f528c7e0f5f68697f6..943e7586575b3e52e9afca71ee6f399273506bba 100755 (executable)
@@ -42,11 +42,13 @@ $AUTOMAKE --add-missing
 
 ./configure
 $MAKE
-test "`cat a/foo.sh`" = foo
+test "$(cat a/foo.sh)" = foo
 
 $sleep
 echo 'bar' >a/foo.sh.in
 
 cd a
 $MAKE foo.sh
-test "`cat foo.sh`" = bar
+test "$(cat foo.sh)" = bar
+
+:
index 1f66d3f47fd35f85a07d7b60972802e39de0694c..020a6e37e4582f0c0c8ba2d998265fe85a2a4af6 100755 (executable)
@@ -36,7 +36,7 @@ $ACLOCAL
 $AUTOMAKE -Wno-override
 
 # "ps:" should be output in two conditions
-test `grep '[^-]ps:' Makefile.in | wc -l` = 2
+test $(grep -c '[^-]ps:' Makefile.in) -eq 2
 grep '@COND_TRUE@ps: *foobar' Makefile.in
 grep '@COND_FALSE@ps: *ps-am' Makefile.in
 
index 6438c998bc46fa98894320a5b20b3a1dce897dc4..cf57880bc323a85393e63976b15a437ab6ead2b9 100755 (executable)
@@ -28,6 +28,6 @@ $ACLOCAL
 $AUTOMAKE -Wno-override
 
 # Overriding 'html' should cause only one "html:" rule to be output.
-test `grep '^html:' Makefile.in | wc -l` = 1
+test $(grep -c '^html:' Makefile.in) -eq 1
 
 :
index db184b2836701fa29868b10b142d210e2935bdad..a27c663e989ca2408620a8f69060471b9e6540e8 100755 (executable)
@@ -83,7 +83,7 @@ $ACLOCAL
 unset AUTOMAKE_JOBS || :
 AUTOMAKE_run --add-missing
 mv stderr expected
-Makefile_ins=`find . -name Makefile.in`
+Makefile_ins=$(find . -name Makefile.in)
 for file in $Makefile_ins; do
   mv $file $file.exp
 done
index 90583d59c1583ca5515242624423a1b3ad84718a..8d8e6a9729b04fcbf664d92f5b09a73f2eae3bbc 100755 (executable)
@@ -25,15 +25,15 @@ END
 
 # $failure_statuses should be defined to the list of all integers between
 # 1 and 255 (inclusive), excluded 77 and 99.
-failure_statuses=`seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' '`
+failure_statuses=$(seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' ')
 # For debugging.
 echo "failure_statuses: $failure_statuses"
 # Sanity check.
-test `for st in $failure_statuses; do echo $st; done | wc -l` -eq 253 \
+test $(for st in $failure_statuses; do echo $st; done | wc -l) -eq 253 \
   || fatal_ "initializing list of exit statuses for simple failures"
 
 cat > Makefile.am <<END
-LOG_COMPILER = ./do-exit
+LOG_COMPILER = $AM_TEST_RUNNER_SHELL ./do-exit
 fail_tests = $failure_statuses
 TESTS = 0 77 99 $failure_statuses
 \$(TESTS):
@@ -44,7 +44,7 @@ cat > do-exit <<'END'
 echo "$0: $1"
 case $1 in
   [0-9]|[0-9][0-9]|[0-9][0-9][0-9]) st=$1;;
-  */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=`echo x"$1" | sed 's|.*/||'`;;
+  */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=${1##*/};;
   *) st=99;;
 esac
 exit $st
index afc19568d2643bbf1800e90c8f0c89e5c2965aa7..50b734e0f234da4513802341bb371a68009ecc80 100755 (executable)
@@ -30,7 +30,7 @@ END
 cat > Makefile.am << 'END'
 TESTS = foo.test
 ## Provide more debugging info.
-TEST_LOG_COMPILER = $(SHELL) -x
+TEST_LOG_COMPILER = $(SHELL) -ex
 ## Required by foo.test; see below.
 AM_TESTS_FD_REDIRECT = 9>&1
 END
index 1f16d9f03ec3ec2e7bffe28195ce98d817a0a7c1..10519e0724d35211fb5cea70bad1a4115a9cc7b5 100755 (executable)
@@ -69,7 +69,7 @@ END
 sed 's/--chk/--am-test/' chk-compiler > test-compiler
 
 mkdir bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
 cat > bin/t-compiler <<'END'
 #! /bin/sh
index 65db6e6cac5883e4c5d3fed831eccdc6f6271e38..13eee3474311c2c6fda68e35fe074b6bfde8310c 100755 (executable)
@@ -116,7 +116,7 @@ setup_data ()
 
 for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
   test $count = E_HUGE && break
-  count=`expr $count '*' 100` || Exit 99
+  count=$(($count * 100))
   setup_data
   if $MAKE this-will-fail; then
     continue
@@ -125,7 +125,8 @@ for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
     # hit the system command-line limits; we can stop.  But first, for
     # good measure, increase the number of tests of some 20%, to be
     # "even more sure" of really tickling command line length limits.
-    count=`expr '(' $count '*' 12 ')' / 10` || Exit 99
+    count=$(($count * 12))
+    count=$(($count / 10))
     setup_data
     break
   fi
@@ -159,15 +160,15 @@ ls -1 $deepdir | grep '\.log$' > lst
 sed 20q lst # For debugging.
 sed 20q grp # Likewise.
 
-test `cat <grp | wc -l` -eq $count
-test `cat <lst | wc -l` -eq $count
+test $(cat <grp | wc -l) -eq $count
+test $(cat <lst | wc -l) -eq $count
 
 # We need to simulate a failure of two tests.
 st=0
 env TESTS="$deepdir/$tname-1.test $deepdir/$tname-2.test" \
     TEST_LOG_COMPILER=false $MAKE -e check > stdout && st=1
 cat stdout
-test `grep -c '^FAIL:' stdout` -eq 2 || st=1
+test $(grep -c '^FAIL:' stdout) -eq 2 || st=1
 test $st -eq 0 || fatal_ "couldn't simulate failure of two tests"
 unset st
 
@@ -175,7 +176,7 @@ $MAKE recheck > stdout || { cat stdout; Exit 1; }
 cat stdout
 grep "^PASS: .*$tname-1\.test" stdout
 grep "^PASS: .*$tname-2\.test" stdout
-test `LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout` -eq 2
+test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 2
 grep "^# TOTAL: 2$" stdout
 grep "^# PASS:  2$" stdout
 
index 1291764800b1d156d7c0c0f360a9ca9c6fa81bca..e6fd2ade98840e5f23564b2d1a74d6ef3eae3b58 100755 (executable)
@@ -94,7 +94,7 @@ chmod a+x my-shell
 
 cat my-shell
 
-CONFIG_SHELL=`pwd`/my-shell; export CONFIG_SHELL
+CONFIG_SHELL=$(pwd)/my-shell; export CONFIG_SHELL
 
 $ACLOCAL
 $AUTOCONF
index 459a24daf18f608835ebb328a601f82b3821e04f..b152fc53a5a6f3d8e79fd4f43a8707726153a331 100755 (executable)
@@ -69,8 +69,8 @@ cat stdout
 count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
 test -f test-suite.log
 cat test-suite.log
-test `grep -c '^FAIL:' test-suite.log` -eq 1
-test `grep -c '^ERROR:' test-suite.log` -eq 1
+test $(grep -c '^FAIL:' test-suite.log) -eq 1
+test $(grep -c '^ERROR:' test-suite.log) -eq 1
 $EGREP '^(X?PASS|XFAIL|SKIP)' test-suite.log && Exit 1
 test -f baz.log
 test -f bar.log
index d54b9e8272f55183b817721793a7042218f9a782..a793dec2a57eb47b28bb3435f7ad8da313bb141c 100755 (executable)
 while :; do
   for r2h in $RST2HTML rst2html rst2html.py; do
     echo "$me: running $r2h --version"
-    # Don't use "&&" here, or a bug of 'set -e' present in some
-    # versions of the BSD shell will be triggered.  We add the
-    # dummy "else" branch for extra safety.
-    if $r2h --version; then break 2; else :; fi
+    $r2h --version && break 2
+    : For shells with busted 'set -e'.
   done
   skip_all_ "no proper rst2html program found"
 done
index 8e3be0e50720115c3431add04cb33e44f81a02b7..6a6a9983c704786a13c19a1b4184d39f77504eac 100755 (executable)
@@ -98,7 +98,7 @@ cd ..
 # still be ongoing when the parallel one has terminated.
 kill -0 $!
 cat parallel/stdout
-test `grep -c '^PASS:' parallel/stdout` -eq 12
+test $(grep -c '^PASS:' parallel/stdout) -eq 12
 
 # Wait long enough so that there are no open files any more when the
 # post-test cleanup runs.  But exit after we've waited for two minutes
@@ -106,7 +106,7 @@ test `grep -c '^PASS:' parallel/stdout` -eq 12
 # already happened).
 i=1
 while test ! -f serial/test-suite.log && test $i -le 120; do
-  i=`expr $i + 1`
+  i=$(($i + 1))
   sleep '1' # Extra quoting to please maintainer-check.
 done
 $sleep
index a818cfb7089dfa80c9fe7ac422e44b087279802e..7ee11163c6388a72c27775c5f891a1bbd11c39cb 100755 (executable)
@@ -26,4 +26,6 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
-test `$FGREP .PHONY: Makefile.in | wc -l` = 3
+test $($FGREP -c '.PHONY:' Makefile.in) -eq 3
+
+:
index 5db9c47b3d1cc272aab1e135d7fb531e8f3121dc..b8b18a5bd04232490e3b942be58bd05be438ef50 100755 (executable)
@@ -43,7 +43,7 @@ AUTOMAKE_fails
 # Is !CHECK mentioned?
 grep ':.*!CHECK$' stderr
 # Is there only one missing condition?
-test `grep ':  ' stderr | wc -l` = 1
+test $(grep -c ':  ' stderr) -eq 1
 
 # By the way, Automake should suggest using AM_CPPFLAGS,
 # because INCLUDES is an obsolete name.
index 7a8f1870699db8f0365d0efbad22e5abef94823e..2b65e1ac323722ee56abd1bdce5c85ef02a0f061 100755 (executable)
@@ -30,9 +30,9 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-$FGREP '@mandir@ foo' Makefile.in
 
-num=`grep '^mandir =' Makefile.in | wc -l`
-test $num -eq 1
+$FGREP 'mandir' Makefile.in # For debugging.
+$FGREP '@mandir@ foo' Makefile.in
+test $(grep -c '^mandir =' Makefile.in) -eq 1
 
 :
index 7f5a32ec385538af65902cbc3876184339d16d18..e6e299ce6581e52c56f34d2efda7479967d49b49 100755 (executable)
@@ -32,7 +32,6 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails -Wno-portability
-q="[\`'\"]"
-grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr
+grep "^Makefile\.am:3:.* AR .* with '=' before .*'+='" stderr
 
 :
index f3c802158863a43f6a7a3647ff40ca83bc2ce187..981a86899cce3aa785051163a9e2f3ce041cd683 100755 (executable)
@@ -66,6 +66,6 @@ AUTOMAKE_fails
 grep '[cC]annot apply.*+=' stderr
 grep ':   !COND1 and !COND3$' stderr
 # Make sure there is exactly one missing condition.
-test `grep ':  ' stderr | wc -l` = 1
+test $(grep -c ':  ' stderr) -eq 1
 
 :
index c2c2d7e3e830b9110456e41ffcc9c2e99fd755cf..82be4e62c3c4e3604e25e492b13025ea36a16713 100755 (executable)
@@ -62,7 +62,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 $MAKE install
 test -f bar.data
index f437571b9accc14c5a0529f8a453730a332b7855..f3e89a7d7fd49e75aed1b96c77937823cd96074e 100755 (executable)
@@ -54,7 +54,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 $MAKE
 test -f libfoo2.c
index b4b2a925da3ff145598bfb4e79f080c7771fca34..54958145c5ef06ac060775aca306442a46e07171 100755 (executable)
@@ -55,7 +55,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 $MAKE
 test -f libfoo2.c
index a02cb9209b0217571a6f16982f60dca1b8403978..99642c26ae64ed55837d7e027795604b7dfcd160 100755 (executable)
@@ -53,7 +53,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 $MAKE
 $MAKE install
index cda515fb581c692c603ea9f98c7cd12fabfa2353..79c95e2ee4018cae3751c6b5814168179a77b23c 100755 (executable)
@@ -88,7 +88,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 $MAKE
 $MAKE test1 test2
index 681f6d61bfd099de4e43883b064331328adca085..1cd26aebb181ec371db589a7b32f0923b5861c75 100755 (executable)
@@ -31,7 +31,6 @@ cat > foo << 'END'
 #! /bin/sh
 echo Maude
 END
-
 chmod +x foo
 
 mkdir install
@@ -40,7 +39,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure "--prefix=`cd install && pwd`"
+./configure "--prefix=$(cd install && pwd)"
 
 $MAKE
 $MAKE distdir
index b655cf013797fb126525f0af078516304b3e8033..a676a3a6922d7dd304428e6eaccbd687ba6c798c 100755 (executable)
@@ -50,7 +50,7 @@ $AUTOMAKE --copy --add-missing
 # or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
 # file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
 # as is the case with openSUSE 12.1).  See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
 
 $MAKE
index 8db6b0792744c61b2dbf8cf0827d53dfd2151e4a..1495b0b75d02a6f2347a0910893e298631aea459 100755 (executable)
@@ -48,7 +48,7 @@ $AUTOMAKE --copy --add-missing
 # or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
 # file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
 # as is the case with openSUSE 12.1).  See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
 
 # A rule in the Makefile should create subdir.
index 6812231bd5805b516104d0dd8dcb144684afd3ea..7be09110cfc496e2420867d8aadd25aafe13dd2f 100755 (executable)
@@ -62,7 +62,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --copy --add-missing
 
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
 
 $MAKE test-all
 $MAKE test-install
index 121328d6332460ef4d4b673ac4c1134975ff94a1..d8bc6bbfcd9bc0f97d05d95bdae8f9295cb4c904 100755 (executable)
--- a/t/pr87.sh
+++ b/t/pr87.sh
@@ -45,7 +45,7 @@ AC_CONFIG_AUX_DIR([.])
 AM_INIT_AUTOMAKE
 AC_PROG_CC
 AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([`echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`])
+AC_CONFIG_FILES([$(echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g')])
 AC_OUTPUT
 EOF
 
index 064db2bbb40eb7d7ccf7bd52b587506da48abe24..e7ea6346144ef881c8fefd71c5e209d0bf8f3fff 100755 (executable)
@@ -77,7 +77,7 @@ $ACLOCAL
 $AUTOMAKE -a
 $AUTOCONF
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
 ./configure --prefix="$cwd/_inst"
 
 $MAKE install
index f5764b3684ea117f41c5256c60b224426a324b59..0c699422d6aee39e30010b95f7cdab7d85bae6b6 100755 (executable)
@@ -19,7 +19,7 @@
 am_create_testdir=empty
 . ./defs || Exit 1
 
-libdir=`$AUTOMAKE --print-libdir` || Exit 1
+libdir=$($AUTOMAKE --print-libdir) || Exit 1
 case $libdir in /*);; *) Exit 1;; esac
 test -d "$libdir"
 test "$libdir" = "$am_pkgvdatadir"
index 1504f557e63177694d7b492eacb828bf0f3a5d80..03617fb14dfde8aebeeda65e7322444b5cfe00ce 100755 (executable)
@@ -28,7 +28,7 @@ cp "$am_scriptdir/py-compile" . \
   || fatal_ "failed to fetch auxiliary script py-compile"
 
 f=__init__
-for d in foo foo/bar "`pwd`/foo" . .. ../foo ''; do
+for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
   if test -z "$d"; then
     d2=.
   else
index dfa992c1556d1f5b059e59724a389fcc3b63cdb8..3a09f45d33ac3ce4db949069d50fa76e204b48c1 100755 (executable)
@@ -21,7 +21,7 @@
 required=python
 . ./defs || Exit 1
 
-ocwd=`pwd` || Exit 99
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 pyfiles="
   foo.py
index 19883b03d11aba1cbb39af2af5123fac1a1b310b..9dfe0a70db20e0fd3c45bd30a85954eed982d416 100755 (executable)
@@ -43,15 +43,15 @@ month='(0[0-9]|1[012])'
 day='([012][0-9]|3[01])'
 hour='([01][0-9]|2[0123])'
 LC_ALL=C $EGREP "^py-compile $year-$month-$day\.$hour" stdout
-test `wc -l <stdout` -eq 1
+test $(wc -l <stdout) -eq 1
 
 # Unknown option.
 
 for opt in -b -d --foo; do
   ./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
   cat stderr >&2
-  grep "^py-compile: unrecognized option ['\`]$opt'" stderr
-  grep "^Try [\`']py-compile --help' for more information" stderr
+  grep "^py-compile: unrecognized option '$opt'" stderr
+  grep "^Try 'py-compile --help' for more information" stderr
 done
 
 # Missing option argument.
@@ -59,8 +59,8 @@ done
 for opt in --basedir --destdir; do
   ./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
   cat stderr >&2
-  grep "^py-compile: option ['\`]$opt' requires an argument" stderr
-  grep "^Try [\`']py-compile --help' for more information" stderr
+  grep "^py-compile: option '$opt' requires an argument" stderr
+  grep "^Try 'py-compile --help' for more information" stderr
 done
 
 # Missing files.
@@ -69,7 +69,7 @@ for args in '' '--basedir dir' '--destdir dir'; do
   ./py-compile $args 2>stderr && { cat stderr >&2; Exit 1; }
   cat stderr >&2
   grep '^py-compile: no files given' stderr
-  grep "^Try [\`']py-compile --help' for more information" stderr
+  grep "^Try 'py-compile --help' for more information" stderr
 done
 
 :
index 3efa5d0d630c6055f45dee3342311b43846456ed..375b79295426cf3a26ab21342eb95e41c93c77c0 100755 (executable)
@@ -44,14 +44,12 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 test -f py-compile
 
-inst=`pwd`/inst
-
-./configure --prefix="$inst"
+./configure --prefix="$(pwd)/inst"
 $MAKE install
-test -f "$inst/py/yes.py"
-test -f "$inst/py/yes.pyc"
-test ! -f "$inst/py/no.py"
-test ! -f "$inst/py/no.pyc"
+test -f inst/py/yes.py
+test -f inst/py/yes.pyc
+test ! -f inst/py/no.py
+test ! -f inst/py/no.pyc
 
 $MAKE disttest
 
index 56c2b619fc1408c744c1fc442cc41031ea2417b2..97a45c90dcc3b0c626f0d5fa00d7e7aaa4abb4a6 100755 (executable)
@@ -30,8 +30,8 @@ PYTHON=python
 # vary among different python installations, so we need more relaxed
 # and ad-hoc checks for them.  Also, more proper "functional" checks
 # on them should be done in the 'python-virtualenv.test' test.
-PYTHON_VERSION=`$PYTHON -c 'import sys; print(sys.version[:3])'` || Exit 1
-PYTHON_PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` || Exit 1
+PYTHON_VERSION=$($PYTHON -c 'import sys; print(sys.version[:3])') || Exit 1
+PYTHON_PLATFORM=$($PYTHON -c 'import sys; print(sys.platform)') || Exit 1
 PYTHON_EXEC_PREFIX='${exec_prefix}'
 PYTHON_PREFIX='${prefix}'
 pkgpythondir="\${pythondir}/$me"
index c534e8da45bba2d689fc5c1a3e31429995fac91d..15653a6747c4948a352f5f481cc0338f7ac092aa 100755 (executable)
@@ -34,8 +34,8 @@ if test -z "$VIRTUAL_ENV"; then
   framework_failure_ "can't activate python virtual environment"
 fi
 
-cwd=`pwd`
-py_version=`python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))'`
+cwd=$(pwd) || fatal_ "getting current working directory"
+py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))')
 py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages
 
 # We need control over the package name.
index de8c0bbfb3def359c5402e0088141fbf5110022c..0fe5d12d10f8b338c7e35856338b4ffbee871643 100755 (executable)
@@ -53,8 +53,8 @@ $AUTOMAKE Makefile3
 grep "py" Makefile.in Makefile2.in Makefile3.in # For debugging.
 
 for f in Makefile.in Makefile2.in Makefile3.in; do
-  test `grep -c '^py_compile =' $f` -eq 1
-  test `grep -c '^am__py_compile =' $f` -eq 1
+  test $(grep -c '^py_compile =' $f) -eq 1
+  test $(grep -c '^am__py_compile =' $f) -eq 1
 done
 
 :
index b28c3a44955b271deef9976bbab18979f5ee0616..cc1fd5f1200a159e7b4a9d12d76e38a413f45712 100755 (executable)
@@ -50,11 +50,13 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-mkdir inst
-inst=`pwd`/inst
-mkdir build
-cd build
-../configure --prefix="$inst"
+inst=inst_
+mkdir inst_ build_
+cd build_
+
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+../configure --prefix="$cwd/$inst" one=0
 $MAKE install
 test -f "$inst/your/two.py"
 test -f "$inst/your/two.pyc"
@@ -67,7 +69,7 @@ test ! -f "$inst/your/two.py"
 test ! -f "$inst/your/two.pyc"
 test ! -f "$inst/your/two.pyo"
 
-../configure --prefix="$inst" one=1
+../configure --prefix=$cwd/"$inst" one=1
 $MAKE install
 test ! -f "$inst/your/two.py"
 test ! -f "$inst/your/two.pyc"
index 3faeb457f72e70d4d6d7b362b0b62f8fb4337656..d7b0cc7734327a1e935fb87e91e9c749698dfe6b 100755 (executable)
@@ -36,10 +36,8 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-rm -rf inst build
-mkdir inst
-instdir=`pwd`/inst
-mkdir build
+instdir=$(pwd)/inst
+mkdir inst build
 cd build
 ../configure --prefix="/usr"
 $MAKE install DESTDIR=$instdir
index 72021cd86992f8fd23e5e1a4d24172bcd65ed792..33c4275993ba0bb2f77d7509968cb6aeb1deb343 100755 (executable)
@@ -36,14 +36,12 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-mkdir inst
-inst=`pwd`/inst
 mkdir build
 cd build
-../configure --prefix="$inst"
+../configure --prefix="$(pwd)/inst"
 $MAKE install
-test -f "$inst/my/one.py"
-test -f "$inst/my/one.pyc"
-test -f "$inst/my/one.pyo"
+test -f inst/my/one.py
+test -f inst/my/one.pyc
+test -f inst/my/one.pyo
 
 :
index b382b38f99238f10a86fb7f792be6b943b5fa41a..366c9b133de743255a03d239016071cdc1a14c7c 100755 (executable)
@@ -32,7 +32,7 @@ cat > bin/my-python << 'END'
 exec python ${1+"$@"}
 END
 chmod a+x bin/my-python
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
 
 : > Makefile.am
 
index 0e09a4381a61075e7c5be95f27ba64e24dc33682..245cf4fecfda59d66ad4d13559fa954cb0fd2b30 100755 (executable)
@@ -33,6 +33,6 @@ $AUTOMAKE --add-missing
 
 # Simulate no Python.
 ./configure PYTHON=:
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
 
 :
index ec0ac070a6e5fa6b4fda24920f6315499f0f57ee..93f0c96f29a870968d7175dcce4b6021a156fa0d 100755 (executable)
@@ -33,6 +33,6 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 ./configure
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
 
 :
index e567adcde42425de7cb8809c44a9dca256827829..a992aab5f0bd3a0ef3bcb93ada4a369ae3b3206e 100755 (executable)
@@ -33,6 +33,6 @@ $AUTOCONF
 $AUTOMAKE --add-missing
 
 ./configure
-test x"`cat py.out`" = x0:1
+test x"$(cat py.out)" = x0:1
 
 :
index 8f3174025d6de73e2381ff4e14892035d1134a54..7bbc1d40a8ee70dcec718b1050851866484c8e05 100755 (executable)
@@ -38,7 +38,7 @@ mkdir sub
 # Both aclocal and automake are expected to run one and just one time.
 # Create and use wrappers that will verify that.
 
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
 mkdir bin
 
index b88254f4be108483c047950dcba07b5b47ec7b46..93ef22449393ba4534119500955c751381fc6c80 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || Exit 1
 
-ocwd=`pwd` || Exit 1
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 magic1=::MagicStringOne::
 magic2=__MagicStringTwo__
@@ -43,7 +43,8 @@ done
 echo AC_OUTPUT >> "$ocwd"/configure.ac
 : > Makefile.am
 unset d i
-bottom=`pwd`
+
+bottom=$(pwd) || fatal_ "getting current working directory"
 
 cd "$ocwd"
 
index c48c1b8824c11674f23e7f5d7734ca723891a3bb..b6a3340e9aa2675afe310984f31e6322d6448a20 100755 (executable)
@@ -35,30 +35,29 @@ $AUTOCONF
 ./configure
 $MAKE
 
+do_check ()
+{
+  $MAKE >stdout || { cat stdout; Exit 1; }
+  cat stdout
+  test $(grep -c " --run " stdout) -eq 1
+}
+
 # Now, we are set up.  Ensure that, for either missing Makefile.in,
 # or updated Makefile.am, rebuild rules are run, and run exactly once
 # only.
 
 rm -f Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
 
 rm -f sub/Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
 
 $sleep  # Let touched files appear newer.
 
 touch Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
 
 touch sub/Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
 
 :
index 7ee3075784cf1bcb1c9757727c6cb23bb5745bef..2f4349a1a722c8d75a452597667d49ab726e1f18 100755 (executable)
@@ -80,7 +80,7 @@ for vpath in : false; do
   remake_
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile
-  test x"`./foo.sh`" = x"$magic1"
+  test x"$(./foo.sh)" = x"$magic1"
 
   $sleep
   echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
@@ -89,7 +89,7 @@ for vpath in : false; do
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile && Exit 1
   $FGREP $magic2 Makefile
-  test x"`./foo.sh`" = x"$magic2"
+  test x"$(./foo.sh)" = x"$magic2"
 
   $sleep
   echo cat > $srcdir/tweak-configure-in # Make it a no-op again.
index cab606e4d35ea4ac7740be7ed6f362f08532cb41..4e0bfdcf3f11a9930d629aac95f97bb6af1ee4da 100755 (executable)
@@ -82,7 +82,7 @@ for vpath in : false; do
   remake_
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile
-  test x"`./foo.sh`" = x"$magic1"
+  test x"$(./foo.sh)" = x"$magic1"
 
   $sleep
   echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
@@ -91,7 +91,7 @@ for vpath in : false; do
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile && Exit 1
   $FGREP $magic2 Makefile
-  test x"`./foo.sh`" = x"$magic2"
+  test x"$(./foo.sh)" = x"$magic2"
 
   $sleep
   echo cat > $srcdir/tweak-makefile-am # Make it a no-op again.
index efbec30f03fe41ee6981cf6deb28ce6bb6ed9c4a..5ed7893e7f590be271b302dba1dfc0649b92a882 100755 (executable)
@@ -84,7 +84,7 @@ for vpath in : false; do
   remake_
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile
-  test x"`./foo.sh`" = x"$magic1"
+  test x"$(./foo.sh)" = x"$magic1"
 
   $sleep
   echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
@@ -93,7 +93,7 @@ for vpath in : false; do
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile && Exit 1
   $FGREP $magic2 Makefile
-  test x"`./foo.sh`" = x"$magic2"
+  test x"$(./foo.sh)" = x"$magic2"
 
   $sleep
   echo : > $srcdir/tweak-acinclude-m4 # Make it a no-op again.
index dddb08343618095ea9ae776db4fd562bb684ed18..5f4892bbaa36eb722ac02c8a788c6019813aed78 100755 (executable)
@@ -84,7 +84,7 @@ for vpath in : false; do
   remake_
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile
-  test x"`./foo.sh`" = x"$magic1"
+  test x"$(./foo.sh)" = x"$magic1"
 
   $sleep
   echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
@@ -93,7 +93,7 @@ for vpath in : false; do
   $FGREP FINGERPRINT Makefile # For debugging.
   $FGREP $magic1 Makefile && Exit 1
   $FGREP $magic2 Makefile
-  test x"`./foo.sh`" = x"$magic2"
+  test x"$(./foo.sh)" = x"$magic2"
 
   $sleep
   echo cat > $srcdir/tweak-aclocal-m4 # Make it a no-op again.
index 21c638891cfaa437cbcdf3fafed915cf09144de9..f3868e656af6dd06a34843a3d0a34baaaeb93334 100755 (executable)
@@ -23,7 +23,7 @@ plan_ 43
 
 # We still need a little hack to make ./defs work outside automake's
 # tree 'tests' subdirectory.  Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
   "$am_top_builddir"/defs-static >defs-static
 diff "$am_top_builddir"/defs-static defs-static \
   && fatal_ "failed to edit defs-static"
@@ -57,7 +57,7 @@ command_ok_ '"keep_testdirs=yes" causes testdir to be kept around' eval '
      env keep_testdirs=yes \
        $AM_TEST_RUNNER_SHELL -c ". ./defs && echo okok >foo" t/dummy.sh \
      && test -f t/dummy.dir/foo \
-     && test okok = `cat t/dummy.dir/foo`'
+     && test okok = $(cat t/dummy.dir/foo)'
 
 do_clean
 
@@ -133,7 +133,7 @@ if test $have_symlinks = yes; then
 
   command_ok_ "post-cleanup with testdir with zero-perms symlinks" \
               $AM_TEST_RUNNER_SHELL -c '
-    ocwd=`pwd` || exit 1
+    ocwd=$(pwd) || exit 1
     stderr_fileno_=2
     . ./defs || Exit 1
     ln -s "$ocwd/dir" "$ocwd/file" .
index 424367eacf9cd13daac31ee8831fd365d1cc52d6..6a0fbd3c398e7118a2ea47c7357338ed1727f3fa 100755 (executable)
@@ -29,7 +29,7 @@ keep_testdirs=; unset keep_testdirs
 
 # This needs to be consistent with what $AM_TEST_RUNNER_SHELL
 # deems to be the current working directory.
-cwd=`$AM_TEST_RUNNER_SHELL -c 'pwd'` \
+cwd=$($AM_TEST_RUNNER_SHELL -c 'pwd') \
   || fatal_ "can't get current working directory"
 echo "$cwd"
 
@@ -48,17 +48,17 @@ do_check ()
 
 do_check 'testdir has the expected path' \
          'unset am_create_testdir' \
-         'case `pwd` in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
+         'case $(pwd) in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
 
 do_check 'fully pre-populated testdir' \
          'unset am_create_testdir' \
          'test -f install-sh || Exit 1
           test -f configure.ac || Exit 1
-          case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+          case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
 
 do_check 'testdir has the expected path' \
          'am_create_testdir=empty' \
-         'case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+         'case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
 
 do_check 'do not pre-populate testdir' \
          'am_create_testdir=empty' \
@@ -70,6 +70,6 @@ do_check 'do not create nor chdir in testdir' \
           test ! -f t/_self.dir || Exit 1
           test ! -r t/_self.dir || Exit 1
           grep "self-check-dir\.tap" Makefile || Exit 1
-          case `pwd` in '"$cwd"') : ;; *) Exit 1;; esac'
+          case $(pwd) in '"$cwd"') : ;; *) Exit 1;; esac'
 
 :
index 7a92671de38396713df6caab6466d0033e413107..6fff27eeee2a5d7786619ba532ca4831a5137b6a 100755 (executable)
@@ -22,7 +22,7 @@ am_create_testdir=empty
 
 # We still need a little hack to make ./defs work outside automake's
 # tree 'tests' subdirectory.  Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
   "$am_top_builddir"/defs-static > defs-static
 diff "$am_top_builddir"/defs-static defs-static \
   && fatal_ "failed to edit defs-static"
index cddc9b5d70307b6b9e171dd74b5b4dd59e9e8d57..2b720fafa98e5055fd0fda6dead59bf3cdc0b030 100755 (executable)
@@ -48,7 +48,7 @@ do_check abc. 'abc\.'
 
 # If we override $me, ./defs should not modify it.
 
-s=`$AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh`
+s=$($AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh)
 command_ok_ "override of \$me before ./defs causes no error" \
             test $? -eq 0
 
index e19a6814b09b45f36e6e8318255359b201975ecc..63d3d096890080cef885e966536ef90f016d705b 100755 (executable)
@@ -25,7 +25,7 @@ plan_ 32
 
 unset AM_TESTS_REEXEC BASH_VERSION || :
 
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
 cp "$am_top_builddir"/defs . || fatal_ "fetching 'defs' from top_builddir"
 
 #
index 8e31afa1c4f28e8b03700211c6b0b26f06a69524..508f0c7e34c6b3bdd27a95ca6a19703efe8b5522 100755 (executable)
@@ -62,7 +62,7 @@ fi
 
 # We still need a little hack to make ./defs work outside automake's
 # tree 'tests' subdirectory.  Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
   "$am_top_builddir"/defs-static > defs-static
 # Redefining *srcdir and *builddir variables in the environment shouldn't
 # cause problems
index a92230ea50da71ebfd745b7a1e765fe09f05fdfc..8162a4ebe472bd99bf5fbcae4bfddd0005ae668e 100755 (executable)
@@ -26,7 +26,7 @@ unset stderr_fileno_ || :
 check_work ()
 {
   desc=$1 args=$2 exp=$3
-  st=0; got=`seq_ $args` || st=$?
+  st=0; got=$(seq_ $args) || st=$?
   command_ok_ "$desc [exit status = 0]" test $st -eq 0
   command_ok_ "$desc [output]" test x"$exp" = x"$got"
 }
index 8b457caaf7af207f9e55e8c213a811702db1d52f..b418ae9cec3982d6661826771c37b9e8ef5eb04b 100755 (executable)
@@ -58,7 +58,7 @@ do_and_check_silent_build ()
   grep 'CXXLD .*baz' stdout
   grep 'CCLD .*bla'  stdout
 
-  if $rebuild; then :; else
+  if ! $rebuild; then
     grep 'YACC .*foo6\.' stdout
     grep 'YACC .*baz6\.' stdout
     grep 'LEX .*foo5\.'  stdout
@@ -84,7 +84,7 @@ do_and_check_verbose_build ()
 
   $EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
 
-  if $rebuild; then :; else
+  if ! $rebuild; then
     grep 'ylwrap ' stdout
     $EGREP '(LEX|YACC) ' stdout && Exit 1
   fi
index 3949009784c5c6c1d37208fef5f314cd6f46abf0..242c8fe071179a6fa51d9cc204c9a5986138950f 100755 (executable)
@@ -59,7 +59,7 @@ do_and_check_silent_build ()
   grep 'CXXLD .*baz' stdout
   grep 'CCLD .*bla'  stdout
 
-  if $rebuild; then :; else
+  if ! $rebuild; then
     grep 'YACC .*foo6\.' stdout
     grep 'YACC .*baz6\.' stdout
     grep 'LEX .*foo5\.'  stdout
@@ -85,7 +85,7 @@ do_and_check_verbose_build ()
 
   $EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
 
-  if $rebuild; then :; else
+  if ! $rebuild; then
     grep 'ylwrap ' stdout
     $EGREP '(LEX|YACC) ' stdout && Exit 1
   fi
@@ -216,7 +216,7 @@ cp foo6.y sub/baz6.y
 
 mkdir bin
 saved_PATH=$PATH; export saved_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
 $ACLOCAL
 $AUTOMAKE --add-missing
index f420cdfd252d87832cf1dea83c5a7063dbe13471..5566ae31b998c136727b45e2d05835c83e50bc72 100755 (executable)
@@ -41,7 +41,7 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-uncondval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+uncondval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
 
 cat >> Makefile.am << 'END'
 foo_SOURCES += $(BAR_SRCS)
@@ -49,7 +49,7 @@ END
 
 $AUTOMAKE
 
-condval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+condval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
 
 test "x$uncondval" = "x$condval"
 
index 26ad75cf510122d244217610276a79add655786a..8caf93018050b214db220d1ad5addc8953c13bf8 100755 (executable)
@@ -58,7 +58,7 @@ $MAKE
 ./true | grep true
 ./false | grep false
 
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
 test -f ./t-false.$objext
 test -f ./f-false.$objext
 
index 435ce16240d18faa931aa91ce3469ad799e3002c..d0c198f047b8449bb6140f6742e74d7b2cffdffa 100755 (executable)
@@ -57,7 +57,7 @@ $MAKE
 ./true
 ./false && Exit 1
 
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
 test -f ./true-true.$objext
 test -f ./false-true.$objext
 
index 0d087a41a4ba14eab451944deca9693a6eaa919d..dd486cecff25979f8b8475cd3fa92a9b0b41e782 100755 (executable)
--- a/t/spy.sh
+++ b/t/spy.sh
@@ -80,18 +80,18 @@ touch b c
 $sleep
 : > a
 $MAKE
-test "`cat a`" = ''
+test x"$(cat a)" = x
 $sleep
 touch b
 $MAKE
-test "`cat a`" = rule1
+test "$(cat a)" = "rule1"
 # Ensure a is strictly newer than b, so HP-UX make does not execute rule2.
 $sleep
 : > a
 $sleep
 touch c
 $MAKE
-test "`cat a`" = rule2
+test "$(cat a)" = "rule2"
 
 # Unfortunately, the following is not portable to FreeBSD/NetBSD/OpenBSD
 # make, see explanation above.
index 1594707c569e87a76595e4b8b4eb5ba238af0422..d2268d209dc9e88a070bfc05c604b86991f1000a 100755 (executable)
@@ -41,12 +41,11 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-q="[\`'\"]"
 badname='not a standard library name'
 # We're specifically testing for line-number information.
-grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr
+grep "^Makefile\\.am:1:.*'sub/foo'.*$badname" stderr
 grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr
-grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr
+grep "^foo\\.mk:5:.*'zardoz\\.a'.*$badname" stderr
 grep "^foo\\.mk:5:.*libzardoz\\.a" stderr
 
 :
index dfefcd9c2af6fc3a269dbf5396281cc91000341b..abc2c86aaa5ff6fe47bb9c2162e223bbe1bb3e7b 100755 (executable)
@@ -41,7 +41,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-prefix=`cd install && pwd` || Exit 1
+prefix=$(cd install && pwd) || Exit 99
 ./configure --prefix="$prefix"
 $MAKE
 $MAKE install-strip
index 49a5c066c49b99f7af5b8bc1d311259c40245236..9c43496f7eb3c59b648d189c9d6000f7d61dfee5 100755 (executable)
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip.  See sister test strip3.
+# This test needs GNU binutils strip.  See sister test 'strip3.sh'.
 
 required='cc strip'
 . ./defs || Exit 1
@@ -32,21 +32,14 @@ bin_PROGRAMS = foo
 lib_LIBRARIES = libfoo.a
 END
 
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
-
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
 
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
 $MAKE
 $MAKE install-strip
 
index 187e8a58e6324071c952cc0402d455b1d44026f1..897901610b1ed745c8f80e3c7ac3e8e62cbab1aa 100755 (executable)
@@ -15,7 +15,8 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip.  Libtool variant.
+# This test needs GNU binutils strip.  Libtool variant.  See sister
+# test 'strip2.sh'.
 
 required='cc libtoolize strip'
 . ./defs || Exit 1
@@ -32,21 +33,15 @@ bin_PROGRAMS = foo
 lib_LTLIBRARIES = libfoo.la
 END
 
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
 
 libtoolize
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
 $MAKE
 $MAKE install-strip
 
index cfebc998d0e68f2bc26edbb97e822d6d011a0a5c..4d8b18cf7af4029667dffb01c6e27460cc2868da 100755 (executable)
@@ -33,18 +33,16 @@ AC_OUTPUT
 END
 
 oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 # An rm(1) wrapper that fails when invoked too many times.
 mkdir rm-wrap
 max_rm_invocations=6
 count_file=$ocwd/rm-wrap/count
 cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+if ! test \$count -le $max_rm_invocations; then
   echo "rm invoked more than $max_rm_invocations times" >&2
   exit 1
 fi
index 69abc107bae1759a178f25e4ebf0cf50279a250e..a545658f756f21115529493a8087abb287c24e80 100755 (executable)
@@ -34,21 +34,19 @@ END
 echo "OBJEXT='@OBJEXT@'" > get-objext.in
 
 oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 # An rm(1) wrapper that fails when invoked too many times.
 mkdir rm-wrap
 max_rm_invocations=3
 count_file=$ocwd/rm-wrap/count
 cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+test \$count -le $max_rm_invocations || {
   echo "rm invoked more than $max_rm_invocations times" >&2
   exit 1
-fi
+}
 echo "\$count" > '$count_file'
 PATH='$oPATH'; export PATH
 exec rm "\$@"
index 461325af232fb02b75dd5cded8ff16fedad42cf7..aeb4fa957b2acf60926550c5df1f9a7cfb3000bf 100755 (executable)
@@ -57,7 +57,7 @@ $AUTOMAKE -a
 
 ./configure --enable-dependency-tracking
 
-depdir=`sed -n 's/^ *DEPDIR *= *//p' Makefile`
+depdir=$(sed -n 's/^ *DEPDIR *= *//p' Makefile)
 if test x"$depdir" != x; then
   depdir=src/$depdir
 else
index 129b6ea615b11d372e098d4b66064883a9961826..eef884f02896af8656ff056703e558df7b2d83ab 100755 (executable)
@@ -69,7 +69,7 @@ grep 'include.*//.*foobar' Makefile.in && Exit 1
 # internals are changed.
 for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
   case $x in
-   */*) d=`echo $x | sed 's,[^/]*$,,'`; b=`echo $x | sed 's,^.*/,,'`;;
+   */*) d=$(echo $x | sed 's,[^/]*$,,'); b=$(echo $x | sed 's,^.*/,,');;
      *) d=''; b=$x;;
   esac
   # Be a little lax in the regexp, to account for automake conditionals,
index f706edf4d1cc479cb5a768918fad0e4b254b56a7..6964a80cc71159e4460b83b6b3948cac9c2e2eaf 100755 (executable)
@@ -37,7 +37,7 @@ END
 
 cat > Makefile.am << 'END'
 noinst_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = src/foo.cc .//src/bar.cc  # The `.//' is meant.
+libfoo_la_SOURCES = src/foo.cc .//src/bar.cc  # The './/' is meant.
 .PHONY: print
 print:
        @echo BEG1: "$(LTCXXCOMPILE)" :1END
index bef3bf0bdc9bf6f78b8eb5352192c91b85d57fa1..9d3b63de338dd5545feab2e5da15373a35d07382 100755 (executable)
@@ -59,14 +59,14 @@ grep '^am_c_OBJECTS = ' Makefile.in
 grep '^am_d_OBJECTS = ' Makefile.in
 
 # Now the actual test.  Are both values equal?
-cobj=`sed -n '/^am_c_OBJECTS = / {
-                s/.* = \(.*\)$/\1/
-                p
-              }' Makefile.in`
-dobj=`sed -n '/^am_d_OBJECTS = / {
-                s/^.* = \(.*\)$/\1/
-                p
-              }' Makefile.in`
+cobj=$(sed -n '/^am_c_OBJECTS = / {
+                 s/.* = \(.*\)$/\1/
+                 p
+               }' Makefile.in)
+dobj=$(sed -n '/^am_d_OBJECTS = / {
+                 s/^.* = \(.*\)$/\1/
+                 p
+              }' Makefile.in)
 test "$cobj" = "$dobj"
 
 :
index 2069e3a1c3970351a5f4d7cb8f5e06fc25abdbd5..aed52bcd7de4ee015e485845255cc42e6650aca9 100755 (executable)
@@ -70,7 +70,7 @@ $AUTOMAKE
 # For debugging.
 $EGREP -n 'ABCD|am__empty' Makefile.in
 # Sanity check.
-test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 3
+test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
 
 ./configure
 {
index cc81063e373808deb50e3e2d6bab3507af3d60ec..f2013361482194fc94970e8eb2857f04a33631e6 100755 (executable)
@@ -23,7 +23,7 @@ cat >> configure.ac <<'EOF'
 AC_PROG_CC
 AM_PROG_AR
 AC_PROG_RANLIB
-if test -n "$doit"; then
+if test x"$doit" = x"yes"; then
   AC_SUBST([basehdr], [sub/base.h])
   AC_SUBST([nobasehdr], [sub/nobase.h])
   AC_SUBST([basedata], [sub/base.dat])
@@ -139,7 +139,7 @@ rm -f install-sh
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
 
 $MAKE
 $MAKE test-install-data
@@ -147,9 +147,9 @@ $MAKE test-install-exec
 $MAKE uninstall
 $MAKE clean
 
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
 
 $MAKE
 $MAKE test-install-nothing-data
@@ -162,14 +162,14 @@ $MAKE uninstall
 $MAKE distclean
 mkdir build
 cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
 $MAKE
 $MAKE test-install-data
 $MAKE test-install-exec
 $MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
 
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
 $MAKE
 $MAKE test-install-nothing-data
 $MAKE test-install-nothing-exec
index 2e695f8431d32ae8c3984bd273a7832d059affea..5fd4f826afa3f485805ed81d9dcd656cddc9b24f 100755 (executable)
@@ -46,5 +46,6 @@ $ACLOCAL
 AUTOMAKE_fails
 grep 'overrid.*libfake@SUBST@.a' stderr
 $AUTOMAKE -Wno-override
-num=`grep '^libfake@SUBST@.a:' Makefile.in | wc -l`
-test $num -eq 1
+test $(grep -c '^libfake@SUBST@.a:' Makefile.in) -eq 1
+
+:
index 600aedf1e273157db84e7b8380f7f568573a76d5..899118de0d279aa83826d317c8e99a351cd097cd 100755 (executable)
@@ -46,13 +46,13 @@ for use_arlib in false :; do
 
   $AUTOMAKE $am_warns -i
   grep '^ *\.c' Makefile.in # For debugging.
-  test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-  test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+  test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+  test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
 
   $AUTOMAKE $am_warns
   grep '^ *\.c' Makefile.in # For debugging.
-  test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-  test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+  test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+  test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
 
 done
 
index 6dd26164da242ab87ebd82327c54ed963ced682f..5bf24d3b18f4be7374c0dedbf7f8c8fccee9e8c9 100755 (executable)
@@ -43,12 +43,12 @@ $ACLOCAL
 
 $AUTOMAKE -a
 grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
 
 $AUTOMAKE -i
 grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
 
 :
index f4b4338d8265ddf5cc1d0a79390facc560551577..b57f02a43b5d86c52132a365abc0ed2d71d1be31 100755 (executable)
@@ -35,6 +35,6 @@ AUTOMAKE_fails --add-missing
 grep '^configure\.ac:3: .*missing.*error while making link' stderr
 grep '^configure\.ac:3: .*install-sh.*error while making link' stderr
 
-test `$FGREP -c 'error while making link' stderr` -eq 2
+test $(grep -c 'error while making link' stderr) -eq 2
 
 :
index ff838872675a287fbc5d627a3822e4d5211e8369..bbdd54218785a5794094efa3cf0ef07b3cd13736 100755 (executable)
@@ -66,8 +66,8 @@ grep '^PASS: baz\.test 1$'            stdout
 
 $FGREP 'Not seen' stdout && Exit 1
 
-test `$FGREP -c ': foo.test' stdout` -eq 1
-test `$FGREP -c ': bar.test' stdout` -eq 2
-test `$FGREP -c ': baz.test' stdout` -eq 2
+test $($FGREP -c ': foo.test' stdout) -eq 1
+test $($FGREP -c ': bar.test' stdout) -eq 2
+test $($FGREP -c ': baz.test' stdout) -eq 2
 
 :
index c19c326b7ac4f986123936bca3d547f4a3df1cb2..2e12e6ec02483a7dd2f04b03ea8e7e12ce5a760d 100755 (executable)
@@ -138,7 +138,7 @@ test -f test-suite.log
 
 grep '^ERROR: bail\.test - Bail out!' stdout
 grep '^PASS:' stdout && Exit 1
-test `$FGREP -c ': bail.test' stdout` -eq 1
+test $($FGREP -c ': bail.test' stdout) -eq 1
 $FGREP 'success.test' stdout && Exit 1
 
 # Override TEST_LOGS from the command line, making it point to a test
index c90f46fe0c56b719e50987cd078c5abe1168b6eb..fc2d36acf64f2755383954e495b18782df690bf6 100755 (executable)
@@ -57,7 +57,7 @@ for string in \
 '## leave its behaviour in this context undefined for the moment.'
 do
   case $string in '##'*) continue;; esac
-  i=`expr $i + 1`
+  i=$(($i + 1))
   unindent >> Makefile.am << END
     TEST_EXTENSIONS += .t$i
     TESTS += foo$i.t$i
index c849d657ddb395b73746e560ab7a96593c70b1eb..e23d96b89997cd764ff95540ce67fbabffef7cbb 100755 (executable)
@@ -118,6 +118,6 @@ grep "^# all.test:${ws0p}bar${ws0p}$" stdout
 grep "^# all.test:${ws1p}zardoz${ws0p}$" stdout
 grep "^# all.test:${ws1p}foo  bar${tab}baz${ws0p}$" stdout
 
-test `grep -c '^# all\.test:' stdout` -eq 4
+test $(grep -c '^# all\.test:' stdout) -eq 4
 
 :
index 846a9d0e63e22534f3155253a6f8329cb749012e..e17cc78a97c0862b90e4d8e2c17d7d82d780eed7 100755 (executable)
@@ -24,9 +24,9 @@
 #
 # From manpage Test::Harness::TAP(3):
 #
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+#   Lines written to standard output matching /^(not )?ok\b/ must be
 #   interpreted as test lines. All other lines must not be considered
-#   test output.''
+#   test output.
 #
 # Unfortunately, the exact format of TODO and SKIP directives is not as
 # clearly described in that manpage; but a simple reverse-engineering of
index 6ab67c9f61d1d1abe608f74f648c658d92efe613..4bf014f8af9d52614961d5aa05093d04144bd415 100755 (executable)
@@ -24,9 +24,9 @@
 #
 # From manpage Test::Harness::TAP(3):
 #
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+#   Lines written to standard output matching /^(not )?ok\b/ must be
 #   interpreted as test lines. All other lines must not be considered
-#   test output.''
+#   test output.
 #
 # Unfortunately, the exact format of TODO and SKIP directives is not as
 # clearly described in that manpage; but a simple reverse-engineering of
@@ -108,7 +108,7 @@ xfail=130 # = 4 * 34 - 6
 xpass=130 # = 4 * 34 - 6
 skip=130  # = 4 * 34 - 6
 error=0
-total=`expr $pass + $fail + $xfail + $xpass + $skip`
+total=$(($pass + $fail + $xfail + $xpass + $skip))
 
 # Even nastier!  But accordingly to the specifics, it should still work.
 for result in 'ok' 'not ok'; do
@@ -117,10 +117,10 @@ done
 echo "ok{[(<#${tab}SKIP>)]}" >> all.test
 
 # We have to update some test counts.
-xfail=`expr $xfail + 1`
-xpass=`expr $xpass + 1`
-skip=`expr $skip + 1`
-total=`expr $total + 3`
+xfail=$(($xfail + 1))
+xpass=$(($xpass + 1))
+skip=$(($skip + 1))
+total=$(($total + 3))
 
 # And add the test plan!
 echo 1..$total >> all.test
index 29e582c3fa5785021b18a5bcd8a1f43e766c477b..493a5a46d51f8522d86e4fb9b6253f086c37d58a 100755 (executable)
@@ -102,7 +102,7 @@ cat > skipall.test << 'END'
 END
 
 # We don't care about the exit status of "make check" here.
-TESTS="`echo *.test`" $MAKE -e check || :
+TESTS="$(echo *.test)" $MAKE -e check || :
 cat test-suite.log
 
 grep ':.*ok|not seen' test-suite.log && Exit 1
index 30215c714ea173c0d30b6ebf8f27b1e76f78a53a..6d7a4dd270ba72ce885e48227b55c1749e850be4 100755 (executable)
@@ -138,13 +138,13 @@ ok 4 # TODO
 Bail out!
 END
 
-tests=`echo *.test` # Also required later.
+tests=$(echo *.test) # Also required later.
 
 TESTS="$tests" $MAKE -e check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
 # Dirty trick required here.
-for tst in `echo " $tests " | sed 's/.test / /'`; do
+for tst in $(echo " $tests " | sed 's/\.test / /'); do
   echo :copy-in-global-log: yes >> $tst.trs
 done
 
@@ -154,7 +154,7 @@ cat test-suite.log
 
 have_rst_section ()
 {
-  eqeq=`echo "$1" | sed 's/./=/g'`
+  eqeq=$(echo "$1" | sed 's/./=/g')
   # Assume $1 contains no RE metacharacters.
   sed -n "/^$1$/,/^$eqeq$/p" test-suite.log > got
   (echo "$1" && echo "$eqeq") > exp
index 5faf838941fe521ad1104c2c51b58ac0940c3971..92d63ec018d1c749bb862c138ddad1ea45209d1d 100755 (executable)
@@ -103,8 +103,8 @@ for result in xfail fail xpass skip error; do
   $FGREP "$pmarker $result $pmarker" my.log || st=1
   $FGREP "$cmarker $result $cmarker" my.log || st=1
 done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
 
 # Passed test scripts shouldn't be mentioned in the global log.
 $EGREP '(^pass|[^x]pass)\.test' my.log && Exit 1
@@ -139,8 +139,8 @@ test ! -f my.log
 test ! -f test-suite.log
 # Check that VERBOSE causes the global testsuite log to be
 # emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
 case $out in *"$log"*) ;; *) Exit 1;; esac
 
 touch error2.log test-suite.log my.log
index 7970d7f801eee9fe83472968d8efedb1a90b9241..baa7e28076fd2a1a6b0d2169304f4104f0eeb0aa 100755 (executable)
@@ -127,14 +127,14 @@ for try in 0 1; do
   count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0
   grep '^PASS: 1\.test 1 - mu$' stdout
   grep '^SKIP: 1\.test 2 zardoz # SKIP$' stdout
-  test `$FGREP -c '1.test' stdout` -eq 2
+  test $(grep -c '1\.test' stdout) -eq 2
   grep '^PASS: 2\.test 1$' stdout
   grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
   grep '^PASS: 2\.test 3$' stdout
-  test `$FGREP -c '2.test' stdout` -eq 3
+  test $(grep -c '2\.test' stdout) -eq 3
   grep '^PASS: 3\.test 1 - blah blah blah$' stdout
   grep '^# 3\.test: Some diagnostic$' stdout
-  test `$FGREP -c '3.test' stdout` -eq 2
+  test $(grep -c '3\.test' stdout) -eq 2
 
   # Failure.
 
@@ -152,15 +152,15 @@ for try in 0 1; do
   count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1
   grep '^PASS: 1\.test 1 - mu$' stdout
   grep '^FAIL: 1\.test 2 zardoz$' stdout
-  test `$FGREP -c '1.test' stdout` -eq 2
+  test $(grep -c '1\.test' stdout) -eq 2
   grep '^PASS: 2\.test 1$' stdout
   grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
   grep '^PASS: 2\.test 3$' stdout
-  test `$FGREP -c '2.test' stdout` -eq 3
+  test $(grep -c '2\.test' stdout) -eq 3
   grep '^PASS: 3\.test 1 - blah blah blah$' stdout
   grep '^# 3\.test: Some diagnostic$' stdout
   grep '^ERROR: 3\.test - Bail out! Kernel Panic$' stdout
-  test `$FGREP -c '3.test' stdout` -eq 3
+  test $(grep -c '3\.test' stdout) -eq 3
 
   cd $srcdir
 
index 4cdace02b70b38ed699485befe1aecb0dda3d5a0..0c07510a7809cbbcc31ed2c26fb997ca2b42bae9 100755 (executable)
@@ -57,16 +57,16 @@ $
 >
 END
 
-n=`wc -l <prefixes`
+n=$(wc -l <prefixes)
 
 # See the loop below to understand this initialization.
-pass=`expr $n '*' 3`
+pass=$(($n * 3))
 fail=$pass
-skip=`expr $pass - 3`
+skip=$(($pass - 3))
 xfail=$skip
 xpass=$xfail
 error=0
-total=`expr $pass + $fail + $skip + $xfail + $xpass`
+total=$(($pass + $fail + $skip + $xfail + $xpass))
 
 echo 1..$total > all.test
 
@@ -86,8 +86,10 @@ done >> all.test
 cat all.test # For debugging.
 
 # Sanity checks.
-grep '#.*#' all.test && framework_failure_ "creating all.test"
-test `wc -l <all.test` -lt $highno || framework_failure_ "creating all.test"
+grep '#.*#' all.test \
+  && framework_failure_ "creating all.test"
+test $(wc -l <all.test) -lt $highno \
+  || framework_failure_ "creating all.test"
 
 $MAKE check >stdout || :
 cat stdout
index b9bca21fbf99f98577ddd878c865605bf56a18c6..ea2993d4325176120c7bd8a3fe43d54cee8d338c 100755 (executable)
@@ -36,9 +36,9 @@ END
 
 # According to documentation of Test::Harness::TAP(3):
 #
-#  ``Lines written to standard output matching /^(not )?ok\b/
+#    Lines written to standard output matching /^(not )?ok\b/
 #    must be interpreted as test lines. All other lines must
-#    not be considered test output.''
+#    not be considered test output.
 
 cat >> all.test <<END
  ok
@@ -98,11 +98,11 @@ Bail out
 # Bail out!
 END
 
-cat all.test # For debugging.
 
-# Minor sanity check.
-test `grep -c '^ok1$' all.test` -eq 1 \
-  && test `grep -c '^not ok1$' all.test` -eq 1 \
+# Debugging info and minor sanity check.
+cat all.test \
+  && test $(grep -c '^ok1$' all.test) -eq 1 \
+  && test $(grep -c '^not ok1$' all.test) -eq 1 \
   || framework_failure_ "creating all.test"
 
 $MAKE check >stdout || { cat stdout; Exit 1; }
index 324adb62719833e89d9eb7d0ec05866b4eebc972..bd1bf8d7835b753804bb36e98035334cb07f056a 100755 (executable)
@@ -93,7 +93,7 @@ $
 END
 
 # Strip any extra whitespace, for Solaris' wc.
-planned=`wc -l <punctuation | tr -d " $tab"`
+planned=$(wc -l <punctuation | tr -d " $tab")
 
 echo 1..$planned > all.test
 awk '{print "ok " NR $0 }' punctuation >> all.test
index 9e3d755fa315fbce9434f4e5f5a813e96589dd78..20bba0a59d31fa825ed0fd062b63fdf8b0804fe4 100755 (executable)
@@ -63,10 +63,10 @@ cat stdout
 
 count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
 
-test `$FGREP -c ': a.test' stdout` -eq 3
-test `$FGREP -c ': b.test' stdout` -eq 5
-test `$FGREP -c ': c.test' stdout` -eq 4
-test `$FGREP -c ': d.test' stdout` -eq 5
+test $($FGREP -c ': a.test' stdout) -eq 3
+test $($FGREP -c ': b.test' stdout) -eq 5
+test $($FGREP -c ': c.test' stdout) -eq 4
+test $($FGREP -c ': d.test' stdout) -eq 5
 
 grep '^ERROR: a\.test 71 # OUT-OF-ORDER (expecting 3)$' stdout
 grep '^ERROR: b\.test 4 foo # OUT-OF-ORDER (expecting 3)$' stdout
index 8aca466a56bbcaf2e6a8edfd72547c58db2522be..99fd8c583db506895a7e46ddf5fc26d197ce98f7 100755 (executable)
@@ -45,7 +45,7 @@ cat > e.test <<END
 0..0
 END
 
-tests_list=`echo *.test`
+tests_list=$(echo *.test)
 
 TESTS="$tests_list" $MAKE -e check >stdout && { cat stdout; Exit 1; }
 cat stdout
index 1c752fc75cbd80ba2b88cd8b7b765d22c535b8f9..3a63821cf38a73594c70e57f6a8ecdc194e80bfb 100755 (executable)
@@ -70,7 +70,7 @@ ok 4 # SKIP
 
 END
 
-tests=`echo *.test`
+tests=$(echo *.test)
 
 for tap_flags in "" "--comments"; do
   env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
index 9de6bc509a0acde3850656861020d9cbe0e3c85b..f53534c48487a4a1780d674263f7c852a4be3a3e 100755 (executable)
 
 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
 
-# These nested loops are clearer without indentation.
-
+# These nested loops below are clearer without indentation.
 i=0
 for c1 in s S; do
 for c2 in k K; do
 for c3 in i I; do
 for c4 in p P; do
-  i=`expr $i + 1`
-  case $i in ?) i=0$i; esac
-  echo "1..0 # $c1$c2$c3$c4 foobar" > $i.test
+  i=$(($i + 1))
+  case $i in ?) j=0$i;; *) j=$i;; esac
+  echo "1..0 # $c1$c2$c3$c4 foobar" > $j.test
 done; done; done; done
 
-TESTS="`echo *.test`" $MAKE -e check >stdout || { cat stdout; Exit 1; }
+TESTS="$(echo *.test)" $MAKE -e check >stdout || { cat stdout; Exit 1; }
 cat stdout
 
 count_test_results total=16 pass=0 fail=0 xpass=0 xfail=0 skip=16 error=0
index e0d3513f3baca75503f44d0237fa3936c020c4cc..52917d53c6aba5ca8b76dc2fb7ce2fcfb7ec0044 100755 (executable)
@@ -37,7 +37,7 @@ cat stdout
 
 grep '^SKIP: foo\.test .* from the last line$' stdout
 grep '^SKIP: bar\.test$' stdout
-test `grep -c ': .*\.test' stdout` -eq 2
+test $(grep -c ': .*\.test' stdout) -eq 2
 count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
 
 :
index 7bf3cb12c0cdbe48ca595d06b31d6437122d865b..f216f88a38b654577cc99d4445df748756a4b15f 100755 (executable)
@@ -34,6 +34,6 @@ $MAKE check >stdout && { cat stdout; Exit 1; }
 cat stdout
 
 count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=3
-test `grep -c '^ERROR: all\.test - multiple test plans' stdout` -eq 3
+test $(grep -c '^ERROR: all\.test - multiple test plans' stdout) -eq 3
 
 :
index 142afd7a82f235cea09e6dfa888fde7456cb4547..2c1d9debce344ebac113859b9c5f77f5564a0ee2 100755 (executable)
@@ -72,6 +72,6 @@ grep '^SKIP: baz\.test' stdout # Deliberately laxer, see above for why.
 grep '^SKIP: wget\.test .* wget(1) not installed$' stdout
 grep '^SKIP: curl\.test .* Can'\''t connect to gnu\.org!$' stdout
 grep '^SKIP: mu\.test' stdout | $FGREP "$weirdchars" stdout
-test `grep -c ': .*\.test' stdout` -eq 6
+test $(grep -c ': .*\.test' stdout) -eq 6
 
 :
index d874b0c2c89a7ed33c3b3f81572bc63756283229..2cad91ca177b3a0af330f4ceb100bc1c382827d8 100755 (executable)
@@ -43,7 +43,7 @@ rm -f expect-check
 # out its output progressively and "in sync" with test execution -- it is
 # make that is stowing such output away instead of presenting it to the
 # user as soon as it gets it.
-if using_gmake; then :; else
+if ! using_gmake; then
   case $MAKE in
     *\ -j*) skip_ "doesn't with non-GNU concurrent make";;
   esac
index e23deea4c67282f9b8359214e9a2c580ef296e67..fce48bf6925ce3da3b7f567ff274225f115ee4e1 100755 (executable)
@@ -60,7 +60,7 @@ for sig in $all_signals; do
 END
   echo TESTS += signal-$sig.test >> Makefile.am
 done
-results_count=`ls *.test | wc -l | tr -d "$tab$sp"`
+results_count=$(ls *.test | wc -l | tr -d "$tab$sp")
 
 chmod a+x *.test
 
@@ -70,7 +70,7 @@ $AUTOMAKE
 
 ./configure
 
-system=`uname -s -r || echo unknown` # Needed later.
+system=$(uname -s -r || echo unknown) # Needed later.
 
 signal_caught ()
 {
@@ -120,7 +120,7 @@ command_ok_ '"make check" fails' eval '
 cat stdout # For debugging.
 
 command_ok_ "count of test results" count_test_results \
-  total=`expr $results_count '*' 2` \
+  total=$(($results_count * 2)) \
   pass=$results_count error=$results_count \
   fail=0 xpass=0 xfail=0 skip=0
 
index e8d9dad045f436f78ec3f26b7191d539a8c69961..dce485c9966f90d8f1decfd9f5626654212325fe 100755 (executable)
@@ -148,7 +148,7 @@ for x in 'ok' 'ok 3' 'not ok' 'not ok # TODO' 'ok # TODO' 'ok # SKIP'; do
 END
   $MAKE check >stdout && { cat stdout; Exit 1; }
   cat stdout
-  test `$FGREP -c ': all.test' stdout` -eq 4
+  test $($FGREP -c ': all.test' stdout) -eq 4
   $EGREP '^PASS: all\.test 1($| )' stdout
   $EGREP '^SKIP: all\.test 2($| )' stdout
   $EGREP ': all\.test 3($| )' stdout
index 641ce861df66f984822d683e696d7400ebe5f071..0bf8ac737e8139fee620e67f4258a4682bca73cc 100755 (executable)
@@ -21,7 +21,7 @@
 
 . ./defs || Exit 1
 
-cwd=`pwd` || fatal_ "couldn't get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
 
 echo AC_OUTPUT >> configure.ac
 
@@ -52,7 +52,7 @@ rm -f *.tar.* *has-run*
 
 TAR="$cwd/am--tar foo" $MAKE distcheck
 test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = foo
+test "$(cat am--tar-has-run)" = foo
 
 rm -f *.tar.* *has-run*
 
@@ -60,6 +60,6 @@ TAR=; unset TAR
 # Creative use of eval to pacify maintainer checks.
 eval \$'MAKE dist "TAR=./am--tar mu"'
 test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = mu
+test "$(cat am--tar-has-run)" = mu
 
 :
index 403ce9916c700ea92bd33e8b6e4aa7136f470b8e..65997b109c155c487d7d634c14de477abfb78151 100755 (executable)
--- a/t/tar3.sh
+++ b/t/tar3.sh
@@ -31,7 +31,7 @@ $ACLOCAL
 AUTOMAKE_fails
 grep "^configure\.ac:2:.*mutually exclusive" stderr > tar-err
 cat tar-err
-test 1 = `wc -l < tar-err`
+test 1 -eq $(wc -l < tar-err)
 grep "'tar-pax'" tar-err
 grep "'tar-v7'"  tar-err
 
index ad0e94d4f442e86a3b3ca2aa73163cb6ceb01e27..97a95d89306887d20b7c332721b2635a385bc774 100755 (executable)
@@ -60,7 +60,7 @@ mkdir build
 cd build
 ../configure
 $MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
   ./foo
   ./bar
 fi
@@ -68,7 +68,7 @@ cd ..
 
 ./configure
 $MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
   ./foo
   ./bar
 fi
index dc8e6811fc26f3fbe9fc84ab17f6ec98ff04ee1d..3b08397087c86e80120d5983656cc2adbb9e587e 100755 (executable)
@@ -44,8 +44,8 @@ check-local: $(TEST_SUITE_LOG)
        test -f sub1/baz.trs
 END
 
-cat > checkdir-driver <<'END'
-#! /bin/sh
+echo "#!$AM_TEST_RUNNER_SHELL" > checkdir-driver
+cat >> checkdir-driver <<'END'
 set -e; set -u
 while test $# -gt 0; do
   case $1 in
@@ -60,8 +60,8 @@ done
 echo "log: $log_file" # For debugging.
 echo "trs: $trs_file" # Ditto.
 case $log_file in */*);; *) exit 1;; esac
-dir_log=`expr "$log_file" : '\(.*\)/[^/]*'`
-dir_trs=`expr "$trs_file" : '\(.*\)/[^/]*'`
+dir_log=${log_file%/*}
+dir_trs=${trs_file%/*}
 echo "dir_log: $dir_log" # For debugging.
 echo "dir_trs: $dir_trs" # Likewise.
 test x"$dir_trs" = x"$dir_log" || exit 1
index c660ec276cb6d695ad45074d8ba9245d0b0e43d6..28e170081ac8314e15bd9c3a115010c6175f5708 100755 (executable)
@@ -156,7 +156,7 @@ for vpath in : false; do
   grep '%% fail2 %%' test-suite.log
   grep '%% pass-fail %%' test-suite.log
   grep '%% pass-xpass-fail-xfail-skip-error %%' test-suite.log
-  test `grep -c '%% ' test-suite.log` -eq 4
+  test $(grep -c '%% ' test-suite.log) -eq 4
 
   TESTS='pass.t pass3-skip2-xfail.t' $MAKE -e check >stdout \
     || { cat stdout; cat test-suite.log; Exit 1; }
index 14568c096b55d276d043ed7aea3cea547d219499..d8455deab9f399c4469c9304162da44614983d0c 100755 (executable)
@@ -143,8 +143,8 @@ $AUTOMAKE
 
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
-test `grep -c '^PASS:'  stdout` -eq 3
-test `grep -c '^XFAIL:' stdout` -eq 13
+test $(grep -c '^PASS:'  stdout) -eq 3
+test $(grep -c '^XFAIL:' stdout) -eq 13
 
 for dir in sub1 sub2; do
   cd $dir
@@ -152,9 +152,9 @@ for dir in sub1 sub2; do
   cp x2.test pass.test
   $MAKE check >stdout && { cat stdout; Exit 1; }
   cat stdout
-  test "`cat pass.trs`" = ":test-result: FAIL"
-  test "`cat x1.trs`"   = ":test-result: XPASS"
-  test "`cat x2.trs`"   = ":test-result: XFAIL"
+  test "$(cat pass.trs)" = ":test-result: FAIL"
+  test "$(cat x1.trs)"   = ":test-result: XPASS"
+  test "$(cat x2.trs)"   = ":test-result: XFAIL"
   grep '^FAIL: pass\.test$' stdout
   grep '^XPASS: x1\.test$'  stdout
   grep '^XFAIL: x2\.test$'  stdout
index ce4a7fcdf24faec37d150a73ff5d786230b9cfdc..d56d661a260d08d36284f42b14e32388c5f43fed 100755 (executable)
@@ -41,7 +41,7 @@ LOG_DRIVER_FLAGS = _
 END
 
 mkdir sub bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 
 cat > wrapper.skel <<'END'
 #! /bin/sh
index 9b2f08bba53030d43adcfcc12a192d000b7bc918..12f9c0b9d043a382068482ed8c026607ea67156e 100755 (executable)
@@ -21,7 +21,7 @@
 am_create_testdir=empty
 . ./defs || Exit 1
 
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
 
 do_check ()
 {
index 0f51c3e767c23e3b6b199d491f7e80696a330d9c..b2d8588cc84f3fb7f4a091f45ac59a9c4dd89733 100755 (executable)
@@ -19,7 +19,7 @@
 
 . ./defs || Exit 1
 
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
 mkdir src build
 mv install-sh missing configure.ac src
index e081d797bbcdf673ffb9c33d0d738fde93313769..c8d58ac8b8a43b2d1ed19515f26ae91464b7a832 100755 (executable)
@@ -60,7 +60,7 @@ END
 
 for i in 1 2 3; do
   AUTOMAKE_fails $i
-  lineno=`sed -n 's/^## lineno //p' $i.am` \
+  lineno=$(sed -n 's/^## lineno //p' $i.am) \
     && test 0 -lt "$lineno" \
     || Exit 99
   grep "^$i\\.am:$lineno:.*TEST_EXTENSIONS.*conditional content" stderr
index fa23481ca52e237e6346347eba9c52c43c060156..c4444899b4d487229e31f59ada5d4805d9a40f9b 100755 (executable)
@@ -39,7 +39,7 @@ $AUTOMAKE -a
 grep -i 'log' Makefile.in # For debugging.
 
 for lc in $valid_extensions; do
-  uc=`echo $lc | tr '[a-z]' '[A-Z]'`
+  uc=$(echo $lc | tr '[a-z]' '[A-Z]')
   $FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
   grep "^${uc}_LOG_COMPILE =" Makefile.in
   grep "^\.${lc}\.log:" Makefile.in
@@ -57,7 +57,7 @@ END
 
 AUTOMAKE_fails
 for suf in mu .x-y a-b .t.1 .6c .0 .11  @suf@ .@ext@ '.=' '_&_'; do
-  suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
+  suf2=$(printf '%s\n' "$suf" | sed -e 's/\./\\./')
   $EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
 done
 
index 0e6065db2a50855c4e98c61b86b6b42ef5e34e0e..4a4dec360229bab3e08b32641c4f2fff9cb3e7cd 100755 (executable)
@@ -106,12 +106,12 @@ for result in xfail fail xpass skip error; do
   $FGREP "$pmarker $result $pmarker" my.log || st=1
   $FGREP "$cmarker $result $cmarker" my.log || st=1
 done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
 
 have_rst_section ()
 {
-  eqeq=`echo "$1" | sed 's/./=/g'`
+  eqeq=$(echo "$1" | sed 's/./=/g')
   # Assume $1 contains no RE metacharacters.
   sed -n "/^$1$/,/^$eqeq$/p" $2 > got
   (echo "$1" && echo "$eqeq") > exp
@@ -153,8 +153,8 @@ test ! -f my.log
 test ! -f test-suite.log
 # Check that VERBOSE causes the global testsuite log to be
 # emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
 case $out in *"$log"*) ;; *) Exit 1;; esac
 
 touch error2.log test-suite.log my.log
index 4aa633f3ad26000a0f7df53514af20f146a183fe..d3c05f00f8101bcdb9fa88920fc1dcffb3b8f793 100755 (executable)
@@ -60,7 +60,7 @@ get_escaped_line()
 have_result ()
 {
    cat > exp; echo >> exp; echo logloglog >> exp
-   eline=`get_escaped_line exp`
+   eline=$(get_escaped_line exp)
    sed -n -e "/^$eline$/,/^logloglog$/p" test-suite.log > got
    cat exp; cat got
    diff exp got
index 88747458cced1e6844a0f1e53e110d7bfa220608..0a106b3fca0dc05dbc28c53b8133666426c39de7 100755 (executable)
@@ -109,7 +109,7 @@ cat > n-100 <<END
 :recheck: no
 END
 
-rechecked=`echo y-[0-9]*`
+rechecked=$(echo y-[0-9]*)
 
 for t in [yn]-[0-9]*; do echo $t; done \
   | sed 's/.*/TESTS += &/' >> Makefile.am
index 42456b4079fd2c18af310343ad9b2d5966466a23..b8d13d81d30b46100ca88d8d399a51c979bdf74e 100755 (executable)
@@ -68,11 +68,11 @@ for vpath in : false; do
   $srcdir/configure
 
   $MAKE tb
-  test x"`cat tb`" = x"foo bar sub/zardoz"
+  test x"$(cat tb)" = x"foo bar sub/zardoz"
   rm -f tb
   # Please don't change the order of the stuff in TESTS, below.
   TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' $MAKE -e tb
-  test x"`cat tb`" = x"foo foo2 foo-log foolog a.log.b 0.exe"
+  test x"$(cat tb)" = x"foo foo2 foo-log foolog a.log.b 0.exe"
   rm -f tb
 
   cd $srcdir
index 1d13e7e6bd14e05cb621fda1d8201cdd991831d2..8d2ce74d748770e80481f4204c6a54d1d2aaefd8 100755 (executable)
@@ -110,12 +110,12 @@ xpass_count=23
 error_count=17
 tests_count=120
 
-pass=` seq_ 1 $pass_count  | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count  | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count  | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count  | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count  | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count  | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
 
 do_check $pass $skip $xfail $fail $xpass $error <<END
 $header
@@ -139,12 +139,12 @@ fail_count=126
 xpass_count=17
 error_count=9
 
-pass=` seq_ 1 $pass_count  | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count  | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count  | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count  | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count  | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count  | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
 
 do_check $pass $skip $xfail $fail $xpass $error <<END
 $header
index 7aa958ea0f2ffd8a461dac16e7343540b7a476fb..6a89862bf6f123194230770928ed34b80d79a3bb 100755 (executable)
@@ -50,11 +50,14 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --program-prefix=gnu- --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-prefix=gnu- --prefix "$cwd/inst" \
+                                  --mandir "$cwd/inst/man"
 $MAKE
 $MAKE test-install
 $MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
 
 # Opportunistically test for installdirs.
 rm -rf inst
index a4a94f7a921eae9a6fd99a69f4117c91a2126ff8..357e6b7e1917af790377f00366c3a918ca71c87f 100755 (executable)
@@ -66,17 +66,20 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
-./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-transform-name='s/[12]//' --prefix "$cwd/inst" \
+                                                --mandir "$cwd/inst/man"
 $MAKE
 $MAKE test-install
 $MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
 
 # Also squash all file types in question.
 
 # On newer Cygwin versions, that won't work, likely due to overly
 # aggressive appending of '.exe' suffix when copying/renaming Windows
-# executables).  So let's skip this part of the test if we detect the
+# executables.  So let's skip this part of the test if we detect the
 # faulty heuristic is present.  See also:
 # <http://lists.gnu.org/archive/html/automake-patches/2010-08/msg00153.html>
 # <http://thread.gmane.org/gmane.os.cygwin/119380>
@@ -86,10 +89,11 @@ chmod a+x foo bar.exe
 cp foo bar && cmp foo bar \
   || skip_ "your Cygwin is too aggressive in tweaking '.exe' suffixes"
 
-./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+./configure --program-transform-name='s/.*/foo/' --prefix "$cwd/inst" \
+                                                 --mandir "$cwd/inst/man"
 $MAKE
 $MAKE test-install-foo
 $MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
 
 :
index 6f1b81179ed3074b8326b4763b7f20ba10695b45..9efefa25a18d984dec5b192734633b2137f239e8 100755 (executable)
@@ -78,12 +78,12 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure --program-prefix=gnu- --prefix "`pwd`/inst"
+./configure --program-prefix=gnu- --prefix "$(pwd)/inst"
 
 $MAKE test-install
 
 $MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
 
 # Opportunistically test for installdirs.
 rm -rf inst
index 63417f8b95790eb7a6a71d48f907f95c3c7ac11f..a77c419458279314ca3e1b41f7a170fb930bd0ce 100755 (executable)
@@ -38,7 +38,7 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure "--infodir=`pwd`/_inst"
+./configure "--infodir=$(pwd)/_inst"
 $MAKE
 
 # Make sure .iNN files are installed.
index 93543a78597bd8aac11b2dc5ec6152590cf30a76..6436dd8f041f31f8fe6e9077b3538e751eef03fa 100755 (executable)
@@ -120,7 +120,8 @@ AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
 AM_MAKEINFOFLAGS = --unsupported-option
 EOF
 $AUTOMAKE
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
+
 $MAKE html
 test -f main.html
 test -f sub/main2.html
index e336bba7978989a078d43b3efd93244d59a520b6..223a4eaa6272c38c89f04ee64a87aee1ee95ce63 100755 (executable)
@@ -46,15 +46,21 @@ $AUTOCONF
 $MAKE
 $MAKE distclean
 
-case `pwd` in
+abscwd=$(pwd) || fatal_ "getting current working directory"
+
+case $abscwd in
   *\ * | *\    *)
     skip_ "this test might fail in a directory containing white spaces";;
 esac
 
 mkdir build
 cd build
-../configure "--srcdir=`pwd`/.." "--prefix=`pwd`/_inst" "--infodir=`pwd`/_inst/info"
+../configure --srcdir="$abscwd" \
+             --prefix="$abscwd/build/_inst" \
+            --infodir="$abscwd/build/_inst/info"
+
 $MAKE install
+
 test -f ../main.info
 test ! -f ./main.info
 test -f _inst/info/main.info
index 131300ae9c68f477953359000640994e93859755..f94c0bccef3dba60a697b2c655990fb8ea4c8adb 100755 (executable)
@@ -41,6 +41,8 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure "--prefix=`pwd`/inst" "--infodir=`pwd`/inst/info"
+./configure --prefix="$(pwd)/inst" --infodir="$(pwd)/inst/info"
 $MAKE install-info
 test -f inst/info/main.info
+
+:
index a0013d252a1a8193f003653d78872a4911d4e7ee..eab87dd131664574ffdedff4457c78e5e11bc4e3 100755 (executable)
@@ -34,7 +34,7 @@ grep 'overrides Automake variable.*INFO_DEPS' stderr
 $AUTOMAKE -Wno-override
 
 # There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
 # ... and it is the right one.
 grep '^INFO_DEPS *= *foo.info *$' Makefile.in
 
@@ -55,7 +55,7 @@ grep 'overrides Automake variable.*INFO_DEPS' stderr
 $AUTOMAKE -Wno-override
 
 # There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
 # ... and it is the right one.
 grep '^INFO_DEPS *= *@INFO_DEPS@ *$' Makefile.in
 
index 09ebd5e183bb855aff8cfe1bf755d58d4904175a..1766cacb0fbe4743e4a12302d0532093ca27b229 100755 (executable)
@@ -39,7 +39,7 @@ EOF
 
 chmod +x makeinfo
 
-PATH=`pwd`$PATH_SEPARATOR$PATH
+PATH=$(pwd)$PATH_SEPARATOR$PATH
 export PATH
 
 # Otherwise configure might pick up a working makeinfo from the
index 7fa793858c89a166ad65c2bea2fc90bd25dc1af0..6f0c5a3a41df3874482375aa94e99200a19d7680 100755 (executable)
@@ -32,9 +32,9 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 $MAKE html dvi ps pdf info \
       install-html install-dvi install-ps install-pdf install-info \
       install-man install-data install-exec install uninstall
 
-Exit 0
+:
index eb2cbdcae634e7548d67d2c3c9e59b82238cd16a..6d9c28b4c2fc8eda9f5c066156d22b47514e8e7b 100755 (executable)
@@ -35,7 +35,7 @@ $AUTOMAKE
 # overkill.
 for t in info dist-info dvi-am install-html uninstall-pdf-am; do
   $EGREP "(^| )$t*.:" Makefile.in # For debugging.
-  test `$EGREP -c "(^| )$t(:| *.:)" Makefile.in` -eq 1
+  test $($EGREP -c "(^| )$t(:| *.:)" Makefile.in) -eq 1
 done
 
 :
index aee1fb5b723900ab3dc34faa87b9a4e12ab2d0f3..7eac3425239b89fe96bc44a6e4d9f8ea370934db 100755 (executable)
@@ -53,9 +53,10 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
+# Make it harder to experience false postives when grepping error messages.
 inst=__inst-dir__
 
-./configure --prefix="`pwd`/$inst"
+./configure --prefix="$(pwd)/$inst"
 
 mkdir $inst $inst/share
 : > $inst/share/foobar.txt
index 1ba6ac7edbc756b775073935145890bec1d1bcb8..1be2a26f5abba801f0e0ca63261e7406691fb2f2 100755 (executable)
@@ -40,7 +40,7 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 $MAKE uninstall
 test ! -d inst
index 7e04b60c265ebe08c7c8b41c0ac6b71b0f879228..c353aab256e7a73beeb0700f0daa9d141f9fc72e 100755 (executable)
@@ -36,7 +36,7 @@ mu_CFLAGS = -DHAVE_MU
 baz_SOURCES = baz.c
 END
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   unindent >> Makefile.am <<'END'
     check-local:
        ./zardoz
index 3a9271613225e6d1de12c62212fb9afe51d7a6be..637e73a58d7823666d861672381ec454aef73bf6 100755 (executable)
@@ -47,7 +47,7 @@ cat > foo.vapi <<'END'
 public const string BARBAR;
 END
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   unindent >> Makefile.am <<'END'
     check-local: test2
     .PHONY: test1 test2
index 71c2ee6eb7c468789d0803379b727da107e574c5..cc50ff105b1b37d9d9f0bb997558f105eeb01fc3 100755 (executable)
--- a/t/vala.sh
+++ b/t/vala.sh
@@ -65,7 +65,7 @@ $FGREP 'am_zardoz_OBJECTS' Makefile.in
 $FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
 $FGREP 'zardoz_vala.stamp:' Makefile.in
 $FGREP 'libzardoz_la_vala.stamp:' Makefile.in
-test `$FGREP -c '.stamp:' Makefile.in` -eq 2
+test $($FGREP -c '.stamp:' Makefile.in) -eq 2
 $FGREP 'zardoz.c' Makefile.in
 $FGREP 'zardoz-foo.c' Makefile.in
 $FGREP 'zardoz-bar.c' Makefile.in
@@ -76,7 +76,7 @@ $FGREP 'am_foo_OBJECTS' sub/Makefile.in
 $FGREP 'bar.c' sub/Makefile.in
 $FGREP 'baz.c' sub/Makefile.in
 $FGREP 'foo_vala.stamp:' sub/Makefile.in
-test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
+test $($FGREP -c '.stamp:' sub/Makefile.in) -eq 1
 
 # Check against regression for weird bug due to unescaped '@'
 # characters used in a "..." perl string when writing the vala
index 879803f8b9fe402ed578fbdcf2e8dc94eee1f28e..2d3951abbbd0bc0889e64924150dab777df45082 100755 (executable)
@@ -35,10 +35,7 @@ exit 0
 END
 chmod +x valac
 
-cwd=`pwd`
-
-# Use $cwd instead of `pwd` in the && list below to avoid a bug in
-# the way Solaris/Heirloom Sh handles 'set -e'.
+cwd=$(pwd) || fatal_ "getting current working directory"
 
 $ACLOCAL
 $AUTOMAKE -a
index 6ea2738732799b9d558f8af6a7409459d418f386..1943b8662e3c7bf9ca8f5391397515fb40206fd6 100755 (executable)
@@ -73,11 +73,11 @@ grep PKG_CHECK_MODULES configure && skip_ "pkg-config m4 macros not found"
 ./configure
 $MAKE
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   ./src/foo
   ./src/bar
-  test `./src/foo` = foo
-  test `./src/bar` = bar
+  test "$(./src/foo)" = foo
+  test "$(./src/bar)" = bar
 fi
 
 # Test clean rules.
index 9b52df683fb7c3005d0fed048cb430a259f79ce2..cc9f4dd00d32a001ebb6d73cf637527abb1161bf 100755 (executable)
@@ -53,9 +53,8 @@ AUTOMAKE_fails --add-missing
 # Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
 # Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
 
-
 grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 6
+test $(grep -c 'variable.*is defined but' stderr) -eq 6
 
 # If we add a global -Wnone, all warnings should disappear.
 $AUTOMAKE -Wnone
index eb924cc06470586eefde18f24e788f9125bf81f8..c323fff52490c570950dc1abf4cd555e7a47d0fc 100755 (executable)
@@ -73,7 +73,7 @@ AUTOMAKE_fails -Wno-extra-portability
 
 grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. ' \
   && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 13
+test $(grep -c 'variable.*is defined but' stderr) -eq 13
 
 # If we add a global -Wnone, all warnings should disappear.
 $AUTOMAKE -Wnone
index 1c04ab4273976e7fe618277e721d4f91d319de4b..8d33c44fca8a8e0f0e7658adb8765ce90205bfc7 100755 (executable)
@@ -18,7 +18,7 @@
 
 . ./defs || Exit 1
 
-amver=`$AUTOMAKE --version | sed -e 's/.* //;1q'`
+amver=$($AUTOMAKE --version | sed -e 's/.* //;1q')
 
 # Does the extracted version number seems legit?
 case $amver in
index 9dd3e67121752395e48a21618480c42ae3c487f8..5bea2811b10cd37de3f71d38372c650fa212aaa3 100755 (executable)
@@ -91,7 +91,7 @@ do_check ()
   # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
   # are consistent.
   $EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
-  vmonth=`grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}'`
+  vmonth=$(grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}')
   grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
   # Check that the vers*.texi file is distributed according
   # to $(DISTFILES).
index 6038444b5cbbaabd72a088c9c3877a6e924bc3c9..27b0636f7d266c55f27f3f7cdb456f2f765607ca 100755 (executable)
 required='makeinfo tex texi2dvi-o'
 . ./defs || Exit 1
 
-case `LC_ALL=C date '+%u'` in
-  [1-7]) date_is_posix=:;;
-      *) date_is_posx=false;;
-esac
-$date_is_posix \
-  && day=`LC_ALL=C date '+%d'` && test -n "$day" \
-  && month=`LC_ALL=C date '+%B'` && test -n "$month" \
-  && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
+test $(LC_ALL=C date '+%u') -gt 0 && test $(LC_ALL=C date '+%u') -lt 8 \
+  && day=$(LC_ALL=C date '+%d')   && test -n "$day" \
+  && month=$(LC_ALL=C date '+%B') && test -n "$month" \
+  && year=$(LC_ALL=C date '+%Y')  && test -n "$year" \
   || skip_ "'date' is not POSIX-compliant enough"
-day=`echo "$day" | sed 's/^0//'`
+day=$(echo "$day" | sed 's/^0//')
 
 (echo '\ex\a' | grep x) \
   || skip_ "grep doesn't work on input that is not pure text"
index 5d47f5047c6c52d016deb0601f0ecd165ce9caf0..d0af92411f198ad36a1abef39035faf1d3aa5f67 100755 (executable)
@@ -32,7 +32,7 @@ ko ()
 {
   AUTOMAKE_run $*
   grep '^Makefile\.am:.*:=.*not portable' stderr
-  test `wc -l <stderr` -eq 1
+  test $(wc -l <stderr) -eq 1
 }
 
 set_am_opts()
index 1662d91d655f0b74bced742d68ad820653fccbd0..584f864d0ba41e2f4256fd44773c95e59ed26258 100755 (executable)
@@ -52,7 +52,7 @@ grep '^sub/Makefile.am:.*INCLUDES' stderr
 grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
 grep '^Makefile.am:.*INCLUDES' stderr && Exit 1
 # Only three lines of warnings.
-test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
+test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 3
 
 # On fast machines the autom4te.cache created during the above run of
 # $AUTOMAKE is likely to have the same time stamp as the configure.ac
@@ -71,3 +71,5 @@ AC_OUTPUT
 END
 $ACLOCAL
 $AUTOMAKE
+
+:
index b2f3f6a78714bb0fb218fbaef5df662091ea8b0c..9a9a1665c3925cbd3723646c71264b7dc1a66ab7 100755 (executable)
@@ -40,7 +40,7 @@ $ACLOCAL
 AUTOMAKE_fails -Wno-error
 grep 'VAR multiply defined' stderr
 grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
 
 sed '/AUTOMAKE_OPTIONS/d' sub/Makefile.am > t
 mv -f t sub/Makefile.am
@@ -48,7 +48,7 @@ mv -f t sub/Makefile.am
 AUTOMAKE_fails -Wno-error
 grep 'VAR multiply defined' stderr
 grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
 
 sed '/AUTOMAKE_OPTIONS/d' Makefile.am > t
 mv -f t Makefile.am
@@ -56,7 +56,7 @@ mv -f t Makefile.am
 AUTOMAKE_fails -Werror
 grep 'VAR multiply defined' stderr
 grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
 
 AUTOMAKE_run -Wno-error
 grep 'VAR multiply defined' stderr
index d2fd49061c34e2f9246528a21f99affa6b10248b..34c7565b234b3f58fbb9463323f16c768dc24928 100755 (executable)
@@ -67,7 +67,7 @@ test -f bar-parse.c
 # Check that per-object flags are honored.
 test -f bar-parse.output
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   echo a | ./foo
   echo b | ./foo && Exit 1
   echo a | ./bar
index 41a25ec4a304bac0a96e05539983fdf3b4eae076..94e5dad89ba8069a9935ae99f68711a181189ab8 100755 (executable)
@@ -89,7 +89,7 @@ test -f foo4-parse4.cpp
 test -f foo3-parse3.output
 test -f foo4-parse4.output
 
-if cross_compiling; then :; else
+if ! cross_compiling; then
   for i in 1 2 3 4; do
     echo a | ./foo$i
     echo b | ./foo$i && Exit 1
index 6f02f1109d3193bced0d5e3066bf73e2d0a820ac..52abb87a1b52e74140fdc7321995486d96088294 100755 (executable)
@@ -65,7 +65,7 @@ exit 1
 END
 cp bin/yacc bin/bison
 chmod a+x bin/yacc bin/bison
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
 
 YACC=yacc BISON=bison
 export YACC BISON
index 6507b510329bdcb37be90e294c8cc242a31b661b..791066a6255fc5bf522765985ce79e270242702b 100755 (executable)
@@ -78,7 +78,7 @@ touch parse.y parse2.y
 $sleep
 $MAKE parse.c parse2.c
 stat parse.c parse.y parse2.c parse2.y || : # For debugging.
-test `ls -t parse.c parse.y | sed 1q` = parse.c
-test `ls -t parse2.c parse2.y | sed 1q` = parse2.c
+test $(ls -t parse.c parse.y | sed 1q) = parse.c
+test $(ls -t parse2.c parse2.y | sed 1q) = parse2.c
 
 :
index bab627dfb6a0d3ca6629a14909170ff4f449c223..5dead213100c53ec5b0b3f512c0589bbbb4d72b9 100755 (executable)
@@ -79,12 +79,12 @@ $sleep
 $sleep
 touch ../foo/parse.y
 $MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = z
+test $(ls -1t foo/parse.h z | sed 1q) = z
 $sleep
 sed 's/%%/%token TOKEN\n%%/g' ../foo/parse.y >../foo/parse.yt
 mv -f ../foo/parse.yt ../foo/parse.y
 $MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h
+test $(ls -1t foo/parse.h z | sed 1q) = foo/parse.h
 
 # Now, adds another parser to test ylwrap.
 
index 53038a82ad118d583d7407cda06afd0d3ae88ba1..8a98903dc3c8f26aaf6c4fe002f8dc5f489d85f3 100755 (executable)
@@ -33,7 +33,7 @@ echo "/* $* */" > y.tab.c
 echo 'extern int dummy;' >> y.tab.c
 END
 chmod a+x bin/fake-yacc
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
 YACC=fake-yacc; export YACC
 
 cat > Makefile.am <<'END'