]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: convert nearly all `...` expressions to $(...)
authorJim Meyering <meyering@redhat.com>
Tue, 3 Apr 2012 18:32:44 +0000 (20:32 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 4 Apr 2012 10:20:56 +0000 (12:20 +0200)
Exempt init.sh because it runs before we're assured to have a
shell that groks $(...).  Exempt *.mk because "$" would have to
be doubled, and besides, any `...` expression in a .mk file is
almost certainly evaluated before init.sh is run.  Finally, also
exempt the perl-based tests, because perl's `...` cannot be
converted to $(...).  Do that by running this command:

git grep -l '`.*`' tests \
  | grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \
  | xargs perl -pi -e 's/`(.*?)`/\$($1)/g'

One minor fix-up change was required after that, due to how
quoting differs:
diff --git a/tests/chmod/equals b/tests/chmod/equals
-    expected_perms=$(eval 'echo \$expected_'$dest)
+    expected_perms=$(eval 'echo $expected_'$dest)

Another was to make these required quoting adjustments:
diff --git a/tests/misc/stty b/tests/misc/stty
...
-  rev=$(eval echo "\\\$REV_$opt")
+  rev=$(eval echo "\$REV_$opt")
...
-      rev1=$(eval echo "\\\$REV_$opt1")
-      rev2=$(eval echo "\\\$REV_$opt2")
+      rev1=$(eval echo "\$REV_$opt1")
+      rev2=$(eval echo "\$REV_$opt2")

Also, transform two files that were needlessly excluded above:
(both use perl, but are mostly bourne shell)

  perl -pi -e 's/`(.*?)`/\$($1)/g' \
    tests/du/long-from-unreadable tests/init.cfg

124 files changed:
tests/chgrp/basic
tests/chgrp/default-no-deref
tests/chgrp/deref
tests/chgrp/posix-H
tests/chgrp/recurse
tests/chmod/c-option
tests/chmod/equal-x
tests/chmod/equals
tests/chmod/setgid
tests/chmod/usage
tests/chown/basic
tests/chown/deref
tests/chown/preserve-root
tests/chown/separator
tests/cp/acl
tests/cp/cp-a-selinux
tests/cp/cp-mv-backup
tests/cp/cp-mv-enotsup-xattr
tests/cp/cp-parents
tests/cp/fail-perm
tests/cp/fiemap-empty
tests/cp/file-perm-race
tests/cp/link-preserve
tests/cp/link-symlink
tests/cp/no-deref-link1
tests/cp/no-deref-link2
tests/cp/no-deref-link3
tests/cp/parent-perm-race
tests/cp/perm
tests/cp/preserve-gid
tests/cp/preserve-link
tests/cp/r-vs-symlink
tests/cp/same-file
tests/cp/sparse
tests/cp/special-bits
tests/cp/symlink-slash
tests/dd/bytes
tests/dd/misc
tests/dd/not-rewound
tests/dd/skip-seek2
tests/du/2g
tests/du/8gb
tests/du/basic
tests/du/deref
tests/du/inaccessible-cwd
tests/du/long-from-unreadable
tests/du/long-sloop
tests/du/slink
tests/init.cfg
tests/install/basic-1
tests/install/trap
tests/ln/hard-to-sym
tests/ln/misc
tests/ln/sf-1
tests/ls/inode
tests/ls/nameless-uid
tests/ls/stat-dtype
tests/ls/stat-vs-dirent
tests/ls/symlink-slash
tests/misc/close-stdout
tests/misc/date-sec
tests/misc/df
tests/misc/env
tests/misc/head-c
tests/misc/ls-time
tests/misc/mknod
tests/misc/nice
tests/misc/nohup
tests/misc/od-multiple-t
tests/misc/runcon-no-reorder
tests/misc/selinux
tests/misc/shuf
tests/misc/sort-compress
tests/misc/sort-merge-fdlimit
tests/misc/sort-rand
tests/misc/stat-fmt
tests/misc/stty
tests/misc/stty-invalid
tests/misc/stty-row-col
tests/misc/tee
tests/misc/timeout
tests/mkdir/p-1
tests/mkdir/p-2
tests/mkdir/p-3
tests/mkdir/parents
tests/mkdir/perm
tests/mkdir/special-1
tests/mv/acl
tests/mv/atomic
tests/mv/atomic2
tests/mv/childproof
tests/mv/force
tests/mv/hard-2
tests/mv/hard-3
tests/mv/hard-link-1
tests/mv/i-2
tests/mv/i-3
tests/mv/i-4
tests/mv/i-link-no
tests/mv/leak-fd
tests/mv/part-hardlink
tests/mv/part-symlink
tests/mv/partition-perm
tests/mv/to-symlink
tests/mv/update
tests/other-fs-tmpdir
tests/readlink/can-e
tests/readlink/can-f
tests/readlink/can-m
tests/readlink/rl-1
tests/rm/hash
tests/rm/inaccessible
tests/rm/ir-1
tests/rm/read-only
tests/rm/readdir-bug
tests/rm/unread3
tests/rmdir/ignore
tests/tail-2/assert
tests/tail-2/assert-2
tests/touch/dangling-symlink
tests/touch/empty-file
tests/touch/no-dereference
tests/touch/no-rights
tests/touch/trailing-slash

index 9c384ba3830470f6d9f45c34f92e823b3d8db1ba..8ce2f2ddc9fcc0dbe39570031d55a220eb1325cb 100755 (executable)
@@ -33,53 +33,53 @@ chgrp -R $g1 d || fail=1
 
 d_files='d d/f3'
 
-chgrp $g1 f || fail=1  ; test `stat --p=%g f` = $g1 || fail=1
-chgrp $g2 f || fail=1  ; test `stat --p=%g f` = $g2 || fail=1
-chgrp $g2 f || fail=1  ; test `stat --p=%g f` = $g2 || fail=1
-chgrp '' f  || fail=1  ; test `stat --p=%g f` = $g2 || fail=1
-chgrp $g1 f || fail=1  ; test `stat --p=%g f` = $g1 || fail=1
-chgrp $g1 f || fail=1  ; test `stat --p=%g f` = $g1 || fail=1
-chgrp --reference=f2 f ; test `stat --p=%g f` = $g2 || fail=1
-
-chgrp -R $g2 d ||fail=1; test `stat --p=%g: $d_files` = "$g2:$g2:" || fail=1
-chgrp -R $g1 d ||fail=1; test `stat --p=%g: $d_files` = "$g1:$g1:" || fail=1
-chgrp -R $g2 d ||fail=1; test `stat --p=%g: $d_files` = "$g2:$g2:" || fail=1
-chgrp -R $g1 d ||fail=1; test `stat --p=%g: $d_files` = "$g1:$g1:" || fail=1
-chgrp $g2 d    ||fail=1; test `stat --p=%g: $d_files` = "$g2:$g1:" || fail=1
+chgrp $g1 f || fail=1  ; test $(stat --p=%g f) = $g1 || fail=1
+chgrp $g2 f || fail=1  ; test $(stat --p=%g f) = $g2 || fail=1
+chgrp $g2 f || fail=1  ; test $(stat --p=%g f) = $g2 || fail=1
+chgrp '' f  || fail=1  ; test $(stat --p=%g f) = $g2 || fail=1
+chgrp $g1 f || fail=1  ; test $(stat --p=%g f) = $g1 || fail=1
+chgrp $g1 f || fail=1  ; test $(stat --p=%g f) = $g1 || fail=1
+chgrp --reference=f2 f ; test $(stat --p=%g f) = $g2 || fail=1
+
+chgrp -R $g2 d ||fail=1; test $(stat --p=%g: $d_files) = "$g2:$g2:" || fail=1
+chgrp -R $g1 d ||fail=1; test $(stat --p=%g: $d_files) = "$g1:$g1:" || fail=1
+chgrp -R $g2 d ||fail=1; test $(stat --p=%g: $d_files) = "$g2:$g2:" || fail=1
+chgrp -R $g1 d ||fail=1; test $(stat --p=%g: $d_files) = "$g1:$g1:" || fail=1
+chgrp $g2 d    ||fail=1; test $(stat --p=%g: $d_files) = "$g2:$g1:" || fail=1
 
 rm -f f
 touch f
 ln -s f symlink
 chgrp $g1 f
-test `stat --printf=%g f` = $g1 || fail=1
+test $(stat --printf=%g f) = $g1 || fail=1
 
 # This should not change the group of f.
 chgrp -h $g2 symlink
-test `stat --printf=%g f` = $g1 || fail=1
+test $(stat --printf=%g f) = $g1 || fail=1
 
 # Don't fail if chgrp failed to set the group of a symlink.
 # Some systems don't support that.
-test `stat --printf=%g symlink` = $g2 ||
+test $(stat --printf=%g symlink) = $g2 ||
   echo 'info: failed to set group of symlink' 1>&2
 
-chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1
+chown --from=:$g1 :$g2 f; test $(stat --printf=%g f) = $g2 || fail=1
 
 # This *should* change the group of f.
 # Though note that the diagnostic is misleading in that
 # it says the 'group of 'symlink'' has been changed.
-chgrp $g1 symlink; test `stat --printf=%g f` = $g1 || fail=1
-chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1
+chgrp $g1 symlink; test $(stat --printf=%g f) = $g1 || fail=1
+chown --from=:$g1 :$g2 f; test $(stat --printf=%g f) = $g2 || fail=1
 
 # If -R is specified without -H or L, -h is assumed.
-chgrp -h $g1 f symlink; test `stat --printf=%g symlink` = $g1 || fail=1
+chgrp -h $g1 f symlink; test $(stat --printf=%g symlink) = $g1 || fail=1
 chgrp -R $g2 symlink
-chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1
+chown --from=:$g1 :$g2 f; test $(stat --printf=%g f) = $g2 || fail=1
 
 # Make sure we can change the group of inaccessible files.
 chmod a-r f
-chown --from=:$g2 :$g1 f; test `stat --printf=%g f` = $g1 || fail=1
+chown --from=:$g2 :$g1 f; test $(stat --printf=%g f) = $g1 || fail=1
 chmod 0 f
-chown --from=:$g1 :$g2 f; test `stat --printf=%g f` = $g2 || fail=1
+chown --from=:$g1 :$g2 f; test $(stat --printf=%g f) = $g2 || fail=1
 
 # chown() must not be optimized away even when
 # the file's owner and group already have the desired value.
@@ -96,7 +96,7 @@ chgrp $g1 f
 # ctime is more recent.  This is not a big deal;
 # this test works fine when the files are on a local file system (/tmp).
 chgrp '' f
-test "`ls -C -c -t f g`" = 'f  g' || \
+test "$(ls -C -c -t f g)" = 'f  g' || \
   {
     case $host_triplet in
       *openbsd*) echo ignoring known OpenBSD-specific chgrp failure 1>&2 ;;
index d6553077a35d8dcbaf7fbf83010f6c447f6e8e6d..5d140a8da6a4d44d18d4940e043b4a7862e65647 100755 (executable)
@@ -26,8 +26,8 @@ g2=$2
 mkdir d && touch f && ln -s ../f d/s || framework_failure_
 
 
-g_init=`stat --printf=%g f`
+g_init=$(stat --printf=%g f)
 chgrp -R $g2 d || fail=1
-test `stat --printf=%g f` = $g_init || fail=1
+test $(stat --printf=%g f) = $g_init || fail=1
 
 Exit $fail
index 18946b1fad975c17e017f31bb6022daf41986b2d..4c186ee82ec02d3f4c09ba22f95a3123e1af9d9e 100755 (executable)
@@ -28,7 +28,7 @@ touch f
 ln -s f symlink
 
 chgrp -h $g2 symlink 2> /dev/null
-set _ `ls -ln symlink`
+set _ $(ls -ln symlink)
 g=$5
 test "$g" = $g2 ||
   skip_ "your system doesn't support changing the owner or group" \
@@ -36,25 +36,25 @@ test "$g" = $g2 ||
 
 
 chgrp $g1 f
-set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln f); g=$5; test "$g" = $g1 || fail=1
 
 chgrp -h $g2 symlink || fail=1
-set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln f); g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln symlink); g=$5; test "$g" = $g2 || fail=1
 
 # This should not change the group of f.
 chgrp -h $g2 symlink || fail=1
-set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln f); g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln symlink); g=$5; test "$g" = $g2 || fail=1
 
 chgrp $g2 f
-set _ `ls -ln f`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln f); g=$5; test "$g" = $g2 || fail=1
 
 # This *should* change the group of f.
 # Though note that the diagnostic you'd get with -c is misleading in that
 # it says the 'group of 'symlink'' has been changed.
 chgrp --dereference $g1 symlink
-set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln f); g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln symlink); g=$5; test "$g" = $g2 || fail=1
 
 Exit $fail
index a6474f562d2ffdeb3fe7c0487d8481f7271b4643..3965f1ff52d5636262ac0eebd211a408d451439f 100755 (executable)
@@ -46,7 +46,7 @@ for i in $changed; do
   # Filter out symlinks (entries that end in 's'), since it's not
   # possible to change their group/owner information on some systems.
   case $i in *s) continue;; esac
-  set _ `ls -dgn $i`; shift
+  set _ $(ls -dgn $i); shift
   group=$3
   test $group = $g2 || fail=1
 done
@@ -62,7 +62,7 @@ for i in $not_changed; do
   # Filter out symlinks (entries that end in 's'), since it's not
   # possible to change their group/owner information on some systems.
   case $i in *s) continue;; esac
-  set _ `ls -dgn $i`; shift
+  set _ $(ls -dgn $i); shift
   group=$3
   test $group = $g1 || fail=1
 done
index 9f9587bf3cd1cbc074b0f6301cd0836e1d2bdbb8..95a910f6c27d3fa1707d311ab4ef0eef8af80676 100755 (executable)
@@ -32,22 +32,22 @@ ln -s ../e d/s
 chgrp -R $g1 e/ee || fail=1
 # This should not should change the group of e/ee
 chgrp -R $g2 d
-set _ `ls -ln e/ee`; g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln e/ee); g=$5; test "$g" = $g1 || fail=1
 # This must change the group of e/ee, since -L makes
 # chgrp traverse the symlink from d/s into e.
 chgrp -L -R $g2 d
-set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln e/ee); g=$5; test "$g" = $g2 || fail=1
 
 # This must *not* change the group of e/ee
 chgrp -H -R $g1 d
-set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln e/ee); g=$5; test "$g" = $g2 || fail=1
 
 ln -s d link
 
 # This shouldn't change the group of e/ee either.
 chgrp -H -R $g1 link || fail=1
-set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ $(ls -ln e/ee); g=$5; test "$g" = $g2 || fail=1
 # But it *should* change d/dd.
-set _ `ls -ln d/dd`; g=$5; test "$g" = $g1 || fail=1
+set _ $(ls -ln d/dd); g=$5; test "$g" = $g1 || fail=1
 
 Exit $fail
index 9235b52fc8995ca3669e348b623b19fd3e279ed0..0fc83912a7b70d0d9a0eb5ff15a6cadcc0a5663a 100755 (executable)
@@ -32,7 +32,7 @@ chmod -c g=rwx $file > out || fail=1
 chmod -c g=rwx $file > empty || fail=1
 
 test -s empty && fail=1
-case "`cat out`" in
+case "$(cat out)" in
   "mode of 'f' changed from 0744 "?rwxr--r--?" to 0774 "?rwxrwxr--?) ;;
   *) cat out; fail=1 ;;
 esac
index d2998d137d72712001bf40ea6118fe3f9347be2c..e2cac3478c3c9291075322431989f7578e95c759 100755 (executable)
@@ -25,7 +25,7 @@ touch $file || framework_failure_
 umask 005
 for mode in =x =xX =Xx =x,=X =X,=x; do
   chmod a=r,$mode $file || fail=1
-  case "`ls -l $file`" in
+  case "$(ls -l $file)" in
     ---x--x---*) ;;
     *) fail=1; echo "after 'chmod $mode $file':"; ls -l $file ;;
   esac
index 54c39aedf7a7499e07d45550752651384b2cd4e0..fd92055c2b1ce2bd24160411b7b36249418a72b2 100755 (executable)
@@ -32,15 +32,15 @@ for src in u g o; do
   for dest in u g o; do
     test $dest = $src && continue
     chmod a=,$src=rwx,$dest=$src,$src= f || fail=1
-    actual_perms=`ls -l f|cut -b-10`
-    expected_perms=`eval 'echo \$expected_'$dest`
+    actual_perms=$(ls -l f|cut -b-10)
+    expected_perms=$(eval 'echo $expected_'$dest)
     test "$actual_perms" = "$expected_perms" || fail=1
   done
 done
 
 umask 027
 chmod a=,u=rwx,=u f || fail=1
-actual_perms=`ls -l f|cut -b-10`
+actual_perms=$(ls -l f|cut -b-10)
 test "$actual_perms" = "-rwxr-x---" || fail=1
 
 Exit $fail
index 081c36e0db4df98b74aea759c7d1e1ec2b5561eb..7fc6db214b3a5a1ceee106d1966e15183aefa862 100755 (executable)
@@ -31,7 +31,7 @@ chmod g+s d 2> /dev/null && env -- test -g d ||
     # to which you belong.  When that happens, the above chmod fails.  So
     # here, upon failure, we try to set the group, then rerun the chmod command.
 
-    id_g=`id -g` &&
+    id_g=$(id -g) &&
     test -n "$id_g" &&
     chgrp "$id_g" d &&
     chmod g+s d || framework_failure_
@@ -52,7 +52,7 @@ do
        expected_mode=drwxr-xr-x ;;
     *) expected_mode=drwxr-sr-x ;;
   esac
-  ls_output=`ls -ld d`
+  ls_output=$(ls -ld d)
   case $ls_output in
     $expected_mode*) ;;
     *) fail=1 ;;
index 3a4d1b82a93cc4549279bb640014b95ee8d58a65..9dd65f7cce6a3efdd9d0f994493bd945481ae72d 100755 (executable)
@@ -54,15 +54,15 @@ cases='
   ug,+x f    :
 '
 
-all_files=`echo "$cases" | sed 's/.*://'|sort -u`
+all_files=$(echo "$cases" | sed 's/.*://'|sort -u)
 
 old_IFS=$IFS
 IFS='
 '
 for case in $cases; do
   IFS=$old_IFS
-  args=`expr "$case" : ' *\(.*[^ ]\) *:'`
-  files=`expr "$case" : '.*: *\(.*\)'`
+  args=$(expr "$case" : ' *\(.*[^ ]\) *:')
+  files=$(expr "$case" : '.*: *\(.*\)')
 
   case $files in
   '')
index 98145dac1def7dd2ebef35b379db46e1830d5c46..7c8951c8313feca251b69c1356d8a14eccf0410c 100755 (executable)
@@ -25,12 +25,12 @@ touch f || framework_failure_
 chown -R --preserve-root 0:1 f
 
 # Make sure the owner and group are 0 and 1 respectively.
-set _ `ls -n f`; shift; test "$3:$4" = 0:1 || fail=1
+set _ $(ls -n f); shift; test "$3:$4" = 0:1 || fail=1
 
 # Make sure the correct diagnostic is output
 # Note we output a name even though an id was specified.
 chown -v --from=42 43 f > out || fail=1
-printf "ownership of 'f' retained as `id -nu`\n" > exp
+printf "ownership of 'f' retained as $(id -nu)\n" > exp
 compare exp out || fail=1
 
 # Ensure diagnostics work for non existent files.
@@ -41,19 +41,19 @@ compare exp out || fail=1
 chown --from=0:1 2:010 f || fail=1
 
 # And now they should be 2 and 10 respectively.
-set _ `ls -n f`; shift; test "$3:$4" = 2:10 || fail=1
+set _ $(ls -n f); shift; test "$3:$4" = 2:10 || fail=1
 
 ln -s f slink
 # Applying chown to a symlink with --no-dereference
 # should change only the link.
 chown --no-dereference 0:1 slink || fail=1
 # owner/group on the symlink should be set
-set _ `ls -n slink`; shift; test "$3:$4" = 0:1 || fail=1
+set _ $(ls -n slink); shift; test "$3:$4" = 0:1 || fail=1
 # owner/group on the referent should remain unchanged
-set _ `ls -n f`;     shift; test "$3:$4" = 2:10 || fail=1
+set _ $(ls -n f);     shift; test "$3:$4" = 2:10 || fail=1
 
 chown --no-dereference --from=0:1 2:010 slink || fail=1
 # owner/group on the symlink should be changed
-set _ `ls -n slink`; shift; test "$3:$4" = 2:10 || fail=1
+set _ $(ls -n slink); shift; test "$3:$4" = 2:10 || fail=1
 
 Exit $fail
index 9ba28062e212363f062cd0e0f84f40fa8c416bc3..d42a054128321f5b3d5da856df366d1758d283a8 100755 (executable)
@@ -23,7 +23,7 @@ print_ver_ chown
 ln -s no-such dangle || framework_failure_
 
 
-set _ `ls -ldo dangle`; shift; user=$3
+set _ $(ls -ldo dangle); shift; user=$3
 
 # With 5.2.1 and earlier, this command would mistakenly succeed.
 chown --dereference $user dangle 2> out1 && fail=1
index a9145b7ab039eabde3587553b1aee4c31218f1da..ffad222287f00a406dd7b3610b2e2930750a2ebf 100755 (executable)
@@ -38,13 +38,13 @@ chmod -R --preserve-root u+r / >> out 2>&1 && fail=1
 # since the symlink in question is not a command line argument.
 # Contrary to the above commands, these two should succeed.
 echo '==== test -RHh' >> out
-chown -RHh --preserve-root `id -u` d >> out 2>&1 || fail=1
-chgrp -RHh --preserve-root `id -g` d >> out 2>&1 || fail=1
+chown -RHh --preserve-root $(id -u) d >> out 2>&1 || fail=1
+chgrp -RHh --preserve-root $(id -g) d >> out 2>&1 || fail=1
 
 # These must fail.
 echo '==== test -RLh' >> out
-chown -RLh --preserve-root `id -u` d >> out 2>&1 && fail=1
-chgrp -RLh --preserve-root `id -g` d >> out 2>&1 && fail=1
+chown -RLh --preserve-root $(id -u) d >> out 2>&1 && fail=1
+chgrp -RLh --preserve-root $(id -g) d >> out 2>&1 && fail=1
 
 cat <<\EOF > exp || fail=1
 chown: it is dangerous to operate recursively on '/'
index 6295fd78f88e91d95ac2221f9f62d269cac1bbb6..d4264a8c8b7bbe65803a57e8d4958bbc2b7a423f 100755 (executable)
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ chown
 
-id_u=`id -u` || framework_failure_
+id_u=$(id -u) || framework_failure_
 test -n "$id_u" || framework_failure_
 
-id_un=`id -un` || framework_failure_
+id_un=$(id -un) || framework_failure_
 test -n "$id_un" || framework_failure_
 
-id_g=`id -g` || framework_failure_
+id_g=$(id -g) || framework_failure_
 test -n "$id_g" || framework_failure_
 
-id_gn=`id -gn` || framework_failure_
+id_gn=$(id -gn) || framework_failure_
 test -n "$id_gn" || framework_failure_
 
 # FreeBSD 6.x's getgrnam fails to look up a group name containing
index 94b7af69be92d6b744aaad91978345caac8c9d67..26a7f420a08d7d11468bb0c351fb5bc011c4c88c 100755 (executable)
@@ -31,22 +31,22 @@ touch a/file || framework_failure_
 
 # Ensure that setfacl and getfacl work on this file system.
 skip=no
-acl1=`cd a && getfacl file` || skip=yes
+acl1=$(cd a && getfacl file) || skip=yes
 setfacl -m user:bin:rw- a/file 2> /dev/null || skip=yes
 test $skip = yes &&
   skip_ "'.' is not on a suitable file system for this test"
 
 # copy a file without preserving permissions
 cp a/file b/ || fail=1
-acl2=`cd b && getfacl file` || framework_failure_
+acl2=$(cd b && getfacl file) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 # Update with acl set above
-acl1=`cd a && getfacl file` || framework_failure_
+acl1=$(cd a && getfacl file) || framework_failure_
 
 # copy a file, preserving permissions
 cp -p a/file b/ || fail=1
-acl2=`cd b && getfacl file` || framework_failure_
+acl2=$(cd b && getfacl file) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 # copy a file, preserving permissions, with --attributes-only
@@ -54,7 +54,7 @@ echo > a/file || framework_failure_ # add some data
 test -s a/file || framework_failure_
 cp -p --attributes-only a/file b/ || fail=1
 test -s b/file && fail=1
-acl2=`cd b && getfacl file` || framework_failure_
+acl2=$(cd b && getfacl file) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 Exit $fail
index 11758170d0f99872aa7bceb53e4130507f8ba504..b85298488d9a4d4d8d67487bd2e8e877d73d8def 100755 (executable)
@@ -24,7 +24,7 @@ print_ver_ cp
 require_root_
 require_selinux_
 
-cwd=`pwd`
+cwd=$(pwd)
 cleanup_() { cd /; umount "$cwd/mnt"; }
 
 # This context is special: it works even when mcstransd isn't running.
index 3e6b6ff902ccba692fdd9d4ceb8ae607152e9311..030f722dc644351f0faf97ad36e6e996769492ea 100755 (executable)
@@ -35,7 +35,7 @@ for prog in cp mv; do
     for opt in none off  numbered t  existing nil  simple never; do
       touch $initial_files
         $prog --backup=$opt x y || fail=1
-      echo $initial_files $opt: `ls [xy]*`; rm -f x y y~ y.~?~
+      echo $initial_files $opt: $(ls [xy]*); rm -f x y y~ y.~?~
     done
   done
 done
index 76ede2e3e0c7bd47d0873df97bbfe2124435f1c2..66e54cf11e2bb1c97720c1b4b86e6ecd21fca4e9 100755 (executable)
@@ -23,7 +23,7 @@ print_ver_ cp mv
 
 require_root_
 
-cwd=`pwd`
+cwd=$(pwd)
 cleanup_() { cd /; umount "$cwd/noxattr"; umount "$cwd/xattr"; }
 
 skip=0
index 85fccd63b6d1698c154c9141985c2bad02aa9f47..b325c722b87c072baf3d43dcda4c52b243ad64d5 100755 (executable)
@@ -49,10 +49,10 @@ test -d d/f && fail=1
 chmod go=w d/a || framework_failure_
 cp -a --parents d/a/b/c e || fail=1
 cp -a --parents sym/b/c g || fail=1
-p=`ls -ld e/d|cut -b-10`; case $p in drwxr-xr-x);; *) fail=1;; esac
-p=`ls -ld e/d/a|cut -b-10`; case $p in drwx-w--w-);; *) fail=1;; esac
-p=`ls -ld g/sym|cut -b-10`; case $p in drwx-w--w-);; *) fail=1;; esac
-p=`ls -ld e/d/a/b/c|cut -b-10`; case $p in drwxr-xr-x);; *) fail=1;; esac
-p=`ls -ld g/sym/b/c|cut -b-10`; case $p in drwxr-xr-x);; *) fail=1;; esac
+p=$(ls -ld e/d|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
+p=$(ls -ld e/d/a|cut -b-10); case $p in drwx-w--w-);; *) fail=1;; esac
+p=$(ls -ld g/sym|cut -b-10); case $p in drwx-w--w-);; *) fail=1;; esac
+p=$(ls -ld e/d/a/b/c|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
+p=$(ls -ld g/sym/b/c|cut -b-10); case $p in drwxr-xr-x);; *) fail=1;; esac
 
 Exit $fail
index 3835f6b0fafc3e7870f7afa326e29b6bb8e32320..2c37d6fb1bacfe1ff94e137f9e1d365c908233be 100755 (executable)
@@ -31,7 +31,7 @@ cp -pR D DD > /dev/null 2>&1 && fail=1
 
 # Permissions on DD must be 'dr-x------'
 
-mode=`ls -ld DD|cut -b-10`
+mode=$(ls -ld DD|cut -b-10)
 test "$mode" = dr-x------ || fail=1
 
 chmod 0 D
index efa4b660d769ade9ebcc4409ff4f3702fa49ae2b..4ba4ee30e410e42de1064a091df3e1f8b6e65ffb 100755 (executable)
@@ -29,7 +29,7 @@ fiemap_capable_ fiemap_chk ||
   skip_ 'this file system lacks FIEMAP support'
 rm fiemap_chk
 
-# TODO: rather than requiring `fallocate`, possible add
+# TODO: rather than requiring $(fallocate), possible add
 # this functionality to truncate --alloc
 fallocate --help >/dev/null || skip_ 'The fallocate utility is required'
 fallocate -l 1 -n falloc.test ||
index 46db6f97458f9d561b22f0648556a50866fcda69..fbc9a86eba639275d4b664a75753d0286f595b6d 100755 (executable)
@@ -46,7 +46,7 @@ cp_pid=$!
   echo foo
 ) >fifo
 
-case `cat ls.out` in
+case $(cat ls.out) in
 -???------*) ;;
 *) fail=1;;
 esac
index 785c9e40aef07fb33be4f3ba2d37df41f6c400cd..9ca1705f58aef939471713bbc28ff05e05d36c31 100755 (executable)
@@ -28,8 +28,8 @@ test -f c/a || framework_failure_
 test -f c/b || framework_failure_
 
 
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
@@ -38,8 +38,8 @@ touch a
 ln -s a b
 mkdir c
 cp --preserve=links -R -H a b c
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
@@ -47,24 +47,24 @@ test "$a_inode" = "$b_inode" || fail=1
 # and translates to hard-linked a and b in the destination dir.
 rm -rf a b c d; mkdir d; (cd d; touch a; ln -s a b)
 cp --preserve=links -R -L d c
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
 # Same as above, but starting with a/b hard linked.
 rm -rf a b c d; mkdir d; (cd d; touch a; ln a b)
 cp --preserve=links -R -L d c
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
 # Ensure that --no-preserve=links works.
 rm -rf a b c d; mkdir d; (cd d; touch a; ln a b)
 cp -dR --no-preserve=links d c
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" && fail=1
 # --------------------------------------
 
@@ -73,8 +73,8 @@ rm -rf a b c d
 touch a; ln a b
 mkdir c
 cp -d a b c
-a_inode=`ls -i c/a|sed 's,c/.*,,'`
-b_inode=`ls -i c/b|sed 's,c/.*,,'`
+a_inode=$(ls -i c/a|sed 's,c/.*,,')
+b_inode=$(ls -i c/b|sed 's,c/.*,,')
 test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
@@ -83,7 +83,7 @@ rm -rf a b c d
 touch a; chmod 731 a
 umask 077
 cp -a --no-preserve=mode a b
-mode=`ls -l b|cut -b-10`
+mode=$(ls -l b|cut -b-10)
 test "$mode" = "-rwx------" || fail=1
 umask 022
 # --------------------------------------
index 97fbf4b9b5cb451e6d65ef29865a050cb042680a..57bc9c715935c1938636a9eb0069271e6b6ddfdf 100755 (executable)
@@ -25,7 +25,7 @@ touch file
 ln -s file link || framework_failure_
 touch -m -h -d 2011-01-01 link ||
   skip_ "Your system doesn't support updating symlink timestamps"
-case `stat --format=%y link` in
+case $(stat --format=%y link) in
   2011-01-01*) ;;
   *) skip_ "Your system doesn't support updating symlink timestamps" ;;
 esac
@@ -33,7 +33,7 @@ esac
 # link.cp is probably a hardlink, but may also be a symlink
 # In either case the timestamp should match the original.
 cp -al link link.cp
-case `stat --format=%y link.cp` in
+case $(stat --format=%y link.cp) in
   2011-01-01*) ;;
   *) fail=1 ;;
 esac
index 8600b8e0a82079a520bf40d0d66cb4d88265a4a0..c2a5657937288803e269312086dfcbbba7e01653 100755 (executable)
@@ -34,6 +34,6 @@ cp -d a/foo b 2>/dev/null
 # Fail this test if the exit status is not 1
 test $? = 1 || fail=1
 
-test "`cat a/foo`" = $msg || fail=1
+test "$(cat a/foo)" = $msg || fail=1
 
 Exit $fail
index 96d444fdf5e359b4e2c277395f20519669761f7a..584029954175d208ded213da5aa255364f714ac5 100755 (executable)
@@ -34,6 +34,6 @@ cp -d a b 2>/dev/null
 # Fail this test if the exit status is not 1
 test $? = 1 || fail=1
 
-test "`cat a`" = $msg || fail=1
+test "$(cat a)" = $msg || fail=1
 
 Exit $fail
index 629f2ae8dff55e881e21aa3eddd69a53b0ddb69d..5f63f2699fcb8cc6d2215e0dad051e074cb4d199 100755 (executable)
@@ -31,6 +31,6 @@ cp -d a b 2>/dev/null
 # Fail this test if the exit status is not 1
 test $? = 1 || fail=1
 
-test "`cat a`" = $msg || fail=1
+test "$(cat a)" = $msg || fail=1
 
 Exit $fail
index 4eb79bb47c5431939eceb127228f973ca8419b12..41486fcb13446dbf258fc3602354e01f60c74cb8 100755 (executable)
@@ -48,7 +48,7 @@ do
     echo foo
   ) >$attr/fifo
 
-  ls_output=`cat d/$attr.ls` || fail=1
+  ls_output=$(cat d/$attr.ls) || fail=1
   case $attr,$ls_output in
   ownership,d???--[-S]--[-S]* | \
   mode,d????-??-?* | \
index 2e6126d621d2c68f1880829338a01facb5fa9b24..eb3925da20cc2145e1d6484eb6c6a5746882661b 100755 (executable)
@@ -49,8 +49,8 @@ for u in 31 37 2; do
 
             case "$cmd:$force:$existing_dest" in
               cp:*:yes)
-                _g_perm=`echo rwx|sed 's/[^'$g_perm']/-/g'`
-                _o_perm=`echo rwx|sed 's/[^'$o_perm']/-/g'`
+                _g_perm=$(echo rwx|sed 's/[^'$g_perm']/-/g')
+                _o_perm=$(echo rwx|sed 's/[^'$o_perm']/-/g')
                 expected_perms=-rw-$_g_perm$_o_perm
                 ;;
               cp:*:no)
index 355db4d87269f7a53fd17117dba879a9ce423de9..6f371c3fb449c1be3fb022060c8f502ffe4d40b9 100755 (executable)
@@ -39,7 +39,7 @@ t0() {
   g=$1; shift
   rm -f b || exit 1
   "$@" "$f" b || exit 1
-  s=`stat -c '%u %g' b`
+  s=$(stat -c '%u %g' b)
   if test "x$s" != "x$u $g"; then
     # Allow the actual group to match that of the parent directory
     # (it was set to 0 above).
index df1d8c53f5917166ea2c8ba1ad78fcbb5589b125..5f069af7c0b90b571d85bac62afd7ab1f1e6e7f3 100755 (executable)
@@ -68,7 +68,7 @@ create_target_tree()
 
 # Note we repeat this, creating either one of
 # two hard linked files from source in the dest, so as to
-# test both paths in `cp` for creating the hard links.
+# test both paths in $(cp) for creating the hard links.
 # The path taken by cp is dependent on which cp encounters
 # first in the source, which is non deterministic currently
 # (I'm guessing that results are sorted by inode and
index 15616ffd7ef790fb51d4cf52635ebf304ae74d90..e96c58425816039f3bd0f983b660e620f07ef96f 100755 (executable)
@@ -32,7 +32,7 @@ ln -s no-such-file no-file || framework_failure_
 cp -r no-file junk 2>/dev/null || fail=1
 
 cp -r slink bar 2>/dev/null || fail=1
-set x `ls -l bar`; shift; mode=$1
+set x $(ls -l bar); shift; mode=$1
 case $mode in
   l*) ;;
   *) fail=1;;
index d5abfe82bf7a2002bc702241208aa87738edeb0b..dbd4d01b650a5da68c02e6dfdabca3cbcfc0e190 100755 (executable)
@@ -111,7 +111,7 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 sl2' 'foo hardlink'; do
         # the destination is a copy.
         for f in $args; do
           if test -f $f; then
-            case "`cat $f`" in
+            case "$(cat $f)" in
               "$contents") ;;
               *) echo cp FAILED;;
             esac
index f1633ae0e8864c922b5c7a52ad5a9796e3ea61e4..a552028778660ad0aa2ddba00f8adcbfc7e49fab 100755 (executable)
@@ -24,14 +24,14 @@ require_sparse_support_
 # It has to be at least 128K in order to be sparse on some systems.
 # Make its size one larger than 128K, in order to tickle the
 # bug in coreutils-6.0.
-size=`expr 128 \* 1024 + 1`
+size=$(expr 128 \* 1024 + 1)
 dd bs=1 seek=$size of=sparse < /dev/null 2> /dev/null || framework_failure_
 
 
 cp --sparse=always sparse copy || fail=1
 
 # Ensure that the copy has the same block count as the original.
-test `stat --printf %b copy` -le `stat --printf %b sparse` || fail=1
+test $(stat --printf %b copy) -le $(stat --printf %b sparse) || fail=1
 
 # Ensure that --sparse={always,never} with --reflink fail.
 cp --sparse=always --reflink sparse copy && fail=1
index 40795104c864bf65a285f5324a5bc7b798e03f48..4a00891d95e56a74cb0bbcfebcece1e595cdb118 100755 (executable)
@@ -33,18 +33,18 @@ chmod u=rwx,g=rx,o=rx . || framework_failure_
 
 
 cp -p a a2 || fail=1
-set _ `ls -l a`; shift; p1=$1
-set _ `ls -l a2`; shift; p2=$1
+set _ $(ls -l a); shift; p1=$1
+set _ $(ls -l a2); shift; p2=$1
 test $p1 = $p2 || fail=1
 
 cp -p b b2 || fail=1
-set _ `ls -l b`; shift; p1=$1
-set _ `ls -l b2`; shift; p2=$1
+set _ $(ls -l b); shift; p1=$1
+set _ $(ls -l b2); shift; p2=$1
 test $p1 = $p2 || fail=1
 
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" cp -p c c2 || fail=1
-set _ `ls -l c`; shift; p1=$1
-set _ `ls -l c2`; shift; p2=$1
+set _ $(ls -l c); shift; p1=$1
+set _ $(ls -l c2); shift; p2=$1
 test $p1 = $p2 && fail=1
 
 Exit $fail
index 0b32b9536ca55d6601d4c5c65a50e8cdc52e4a8d..95c9cfa0465f7119189229a677b244c251396cb5 100755 (executable)
@@ -24,7 +24,7 @@ mkdir dir || framework_failure_
 ln -s dir symlink || framework_failure_
 
 cp -dR symlink/ s || fail=1
-set `ls -l s`
+set $(ls -l s)
 
 # Prior to fileutils-4.0q, the following would have output ...'s -> dir'
 # because the trailing slash was removed unconditionally (now you have to
index 15755aae38f4024e727d28cd67e486442863dab7..2d40f06415c405988d19836e4fdd9d288aadc251 100755 (executable)
@@ -21,7 +21,7 @@ print_ver_ dd
 # count_bytes
 echo 0123456789abcdefghijklm > in || framework_failure_
 dd count=14 conv=swab iflag=count_bytes < in > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
  1032547698badc) ;;
  *) fail=1 ;;
 esac
@@ -29,7 +29,7 @@ esac
 # skip_bytes
 echo 0123456789abcdefghijklm > in || framework_failure_
 dd skip=10 iflag=skip_bytes < in > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
  abcdefghijklm) ;;
  *) fail=1 ;;
 esac
@@ -37,7 +37,7 @@ esac
 # skip records and bytes from pipe
 echo 0123456789abcdefghijklm |
  dd skip=10 bs=2 iflag=skip_bytes > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
  abcdefghijklm) ;;
  *) fail=1 ;;
 esac
index aad04dcb14208099b2ebd2620ec7e034ba225d13..52a5b20814d21cf2edb71fc2dffc5dc7256d5d72 100755 (executable)
@@ -57,10 +57,10 @@ if dd iflag=directory if=. count=0 2> /dev/null; then
   dd iflag=directory count=0 <$tmp_in 2> /dev/null && fail=1
 fi
 
-old_ls=`ls -u --full-time $tmp_in`
+old_ls=$(ls -u --full-time $tmp_in)
 sleep 1
 if dd iflag=noatime if=$tmp_in of=$tmp_out 2> /dev/null; then
-  new_ls=`ls -u --full-time $tmp_in`
+  new_ls=$(ls -u --full-time $tmp_in)
   if test "x$old_ls" != "x$new_ls"; then
     cat >&2 <<EOF
 =================================================================
@@ -80,7 +80,7 @@ if dd oflag=nolinks if=$tmp_in of=$tmp_out 2> /dev/null; then
   dd oflag=nolinks < $tmp_in > $tmp_out 2>&1 || fail=1
 fi
 
-outbytes=`echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c`
+outbytes=$(echo x | dd bs=3 ibs=10 obs=10 conv=sync 2>/dev/null | wc -c)
 test "$outbytes" -eq 3 || fail=1
 
 # A delay is required to trigger a failure.
index 284dd4a1a9cf7a30878c459ec57e8c40576fa6b7..5364f907f3649cf53716a86441f91330ea18e3b9 100755 (executable)
@@ -23,7 +23,7 @@ print_ver_ dd
 
 echo abcde > in
 (dd skip=1 count=1 bs=1; dd skip=1 bs=1) < in > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
   bde) ;;
   *) fail=1 ;;
 esac
index e1d3edb41de1bbebdd2fce3fe9fea27ef7d3959d..7f5e0560fe8e7da1ce7d4a9e28b7c84ea461019f 100755 (executable)
@@ -23,14 +23,14 @@ print_ver_ dd
 
 echo LA:3456789abcdef > in || fail=1
 (dd bs=1 skip=3 count=0 && dd bs=5) < in > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
   3456789abcdef) ;;
   *) fail=1 ;;
 esac
 
 echo LA:3456789abcdef > in || fail=1
 (dd bs=1 skip=3 count=0 && dd bs=5 count=2) < in > out 2> /dev/null || fail=1
-case `cat out` in
+case $(cat out) in
   3456789abc) ;;
   *) fail=1 ;;
 esac
index a901ddbe951720be4da4216397fbb01400211f7f..96cf62d7caa30b7bf681186cc8021d7ae411aa3f 100755 (executable)
@@ -30,7 +30,7 @@ very_expensive_
 
 # This technique relies on the fact that the 'Available' kilobyte
 # count is the number just before the one with a trailing '%'.
-free_kb=`df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //'`
+free_kb=$(df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //')
 case "$free_kb" in
   [0-9]*) ;;
   *) skip_ "invalid size from df: $free_kb";;
@@ -47,7 +47,7 @@ test $min_kb -lt $free_kb ||
 big=big
 rm -f $big
 test -t 1 || printf 'creating a 2GB file...\n'
-for i in `seq 100`; do
+for i in $(seq 100); do
   # Note: 2147483648 == 2^31. Print floor(2^31/100) per iteration.
   printf %21474836s x >> $big || fail=1
   # On the final iteration, append the remaining 48 bytes.
index 2028d90a036ffee3e9af37e2c8ab85f6eea7ff15..556423e3c369d4d799e623dcc43d0a4dc693dc26 100755 (executable)
@@ -32,7 +32,7 @@ fi
 # the 'dd' command above mistakenly creates a file of length '0', yet
 # doesn't fail.  The root of that failure is that the ftruncate call
 # returns zero but doesn't do its job.  Detect this failure.
-set x `ls -gG big`
+set x $(ls -gG big)
 size=$4
 if test "$size" = 0; then
   skip_ "cannot create a file large enough for this test
index bb0980eeea389d5cb906b065fa75d9cb834922d0..d8acf6420d785c711e41170202c7f294df0e9da8 100755 (executable)
@@ -29,7 +29,7 @@ printf %4096s x > d/1
 cp d/1 d/sub/2
 
 
-B=`stat --format=%B a/b/F`
+B=$(stat --format=%B a/b/F)
 
 du --block-size=$B -a a > out || fail=1
 echo === >> out
@@ -37,11 +37,11 @@ du --block-size=$B -a -S a >> out || fail=1
 echo === >> out
 du --block-size=$B -s a >> out || fail=1
 
-f=`stat --format=%b a/b/F`
-b=`stat --format=%b a/b`
-a=`stat --format=%b a`
-bf=`expr $b + $f`
-tot=`expr $bf + $a`
+f=$(stat --format=%b a/b/F)
+b=$(stat --format=%b a/b)
+a=$(stat --format=%b a)
+bf=$(expr $b + $f)
+tot=$(expr $bf + $a)
 
 cat <<EOF | sed 's/ *#.*//' > exp
 $f     a/b/F
@@ -65,13 +65,13 @@ if is_local_dir_ .; then
   echo === >> out
   du --block-size=$B -S d | sort -r -k2,2 >> out || fail=1
 
-  t2=`stat --format=%b d/sub/2`
-  ts=`stat --format=%b d/sub`
-  t1=`stat --format=%b d/1`
-  td=`stat --format=%b d`
-  tot=`expr $t1 + $t2 + $ts + $td`
-  d1=`expr $td + $t1`
-  s2=`expr $ts + $t2`
+  t2=$(stat --format=%b d/sub/2)
+  ts=$(stat --format=%b d/sub)
+  t1=$(stat --format=%b d/1)
+  td=$(stat --format=%b d)
+  tot=$(expr $t1 + $t2 + $ts + $td)
+  d1=$(expr $td + $t1)
+  s2=$(expr $ts + $t2)
 
   cat <<EOF | sed 's/ *#.*//' > exp
 $t2    d/sub/2
index bf2ead4d785ecb90e1d6cba9c64695033f3fe201..90b76503924fae069c1b17330962aa213b247af6 100755 (executable)
@@ -39,9 +39,9 @@ du -L dangle > /dev/null 2>&1 && fail=1
 # du -L used to mess up, either by counting the symlink's disk space itself
 # (-L should follow symlinks, not count their space)
 # or (briefly in July 2010) by omitting the entry for "a".
-du_L_output=`du -L a` || fail=1
-du_lL_output=`du -lL a` || fail=1
-du_x_output=`du --exclude=dotdot a` || fail=1
+du_L_output=$(du -L a) || fail=1
+du_lL_output=$(du -lL a) || fail=1
+du_x_output=$(du --exclude=dotdot a) || fail=1
 test "X$du_L_output" = "X$du_x_output" || fail=1
 test "X$du_lL_output" = "X$du_x_output" || fail=1
 
index 39e62584dfbba71e33315cd2196a97d900880a8c..bfc8cf92e53db96a36e5c2aeb6a5214bc4ca93d2 100755 (executable)
@@ -29,7 +29,7 @@ require_openat_support_
 
 skip_if_root_
 
-cwd=`pwd`
+cwd=$(pwd)
 mkdir -p no-x a/b || framework_failure_
 cd no-x || framework_failure_
 chmod 0 . || framework_failure_
index 10864e00ef667afe83d920be6a1685b50b1f1711..7fc129c170b2f9ef6eeafbf5fa7a4bac21f6400c 100755 (executable)
@@ -36,11 +36,11 @@ if test ! -d $proc_file; then
   skip_ 'This test would fail, since your system lacks /proc support.'
 fi
 
-dir=`printf '%200s\n' ' '|tr ' ' x`
+dir=$(printf '%200s\n' ' '|tr ' ' x)
 
 # Construct a hierarchy containing a relative file with a name
 # longer than PATH_MAX.
-# for i in `seq 52`; do
+# for i in $(seq 52); do
 #   mkdir $dir || framework_failure_
 #   cd $dir || framework_failure_
 # done
@@ -51,7 +51,7 @@ dir=`printf '%200s\n' ' '|tr ' ' x`
 #     cannot access parent directories:
 # (all on one line).
 
-cwd=`pwd`
+cwd=$(pwd)
 # Use perl instead:
 : ${PERL=perl}
 $PERL \
index 78926d38fadd1c0b2764179b51b84ec44c6ec8b1..f9e70ad00b602007822cc55072cff476b1537ce8 100755 (executable)
@@ -29,11 +29,11 @@ print_ver_ du
 # in a single directory.
 n=400
 
-dir_list=`seq $n`
+dir_list=$(seq $n)
 mkdir $dir_list || framework_failure_
 file=1
 i_minus_1=0
-for i in $dir_list `expr $n + 1`; do
+for i in $dir_list $(expr $n + 1); do
   case $i_minus_1 in
   0) ;;
   *)
@@ -56,7 +56,7 @@ echo foo > $i
 cat $file > /dev/null 2> err &&
     skip_ 'Your system appears to be able to handle more than $n symlinks
 in file name resolution'
-too_many=`sed 's/.*: //' err`
+too_many=$(sed 's/.*: //' err)
 
 
 # With coreutils-5.93 there was no failure.
index 1f84291715a770ab64fdc5d2afa814d56ce874aa..674e6a2248cf0b389a0b08ab40e6bf5cc2bfc4fc 100755 (executable)
@@ -32,7 +32,7 @@ fi
 
 symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
 for len in $symlink_name_lengths; do
-  name=`seq 1 $len|tr -c x y |head -c$len`
+  name=$(seq 1 $len|tr -c x y |head -c$len)
   # Record the names of symlinks that are successfully created.
   ln -fs $name $len > /dev/null 2>&1 \
     && symlinks="$symlinks $len"
index 17713d9243bc63bb2bb5ab27084e10ee8ca88e94..7bcd512a3e13a39171998dcf609dade6d6d771a2 100644 (file)
@@ -235,9 +235,9 @@ rwx_to_mode_()
   s='s/S/@/;s/s/x@/;s/@/s/'
   t='s/T/@/;s/t/x@/;s/@/t/'
 
-  u=`echo $rwx|sed 's/^.\(...\).*/,u=\1/;s/-//g;s/^,u=$//;'$s`
-  g=`echo $rwx|sed 's/^....\(...\).*/,g=\1/;s/-//g;s/^,g=$//;'$s`
-  o=`echo $rwx|sed 's/^.......\(...\).*/,o=\1/;s/-//g;s/^,o=$//;'$s';'$t`
+  u=$(echo $rwx|sed 's/^.\(...\).*/,u=\1/;s/-//g;s/^,u=$//;'$s)
+  g=$(echo $rwx|sed 's/^....\(...\).*/,g=\1/;s/-//g;s/^,g=$//;'$s)
+  o=$(echo $rwx|sed 's/^.......\(...\).*/,o=\1/;s/-//g;s/^,o=$//;'$s';'$t)
   echo "=$u$g$o"
 }
 
@@ -259,7 +259,7 @@ require_selinux_()
 
   # Independent of whether SELinux is enabled system-wide,
   # the current file system may lack SELinux support.
-  case `ls -Zd .` in
+  case $(ls -Zd .) in
     '? .'|'unlabeled .')
       skip_ "this system (or maybe just" \
         "the current file system) lacks SELinux support"
@@ -316,7 +316,7 @@ require_membership_in_two_groups_()
 {
   test $# = 0 || framework_failure_
 
-  groups=${COREUTILS_GROUPS-`(id -G || /usr/xpg4/bin/id -G) 2>/dev/null`}
+  groups=${COREUTILS_GROUPS-$( (id -G || /usr/xpg4/bin/id -G) 2>/dev/null)}
   case "$groups" in
     *' '*) ;;
     *) skip_ 'requires membership in two groups
@@ -389,7 +389,7 @@ require_sparse_support_()
   # NTFS requires 128K before a hole appears in a sparse file.
   t=sparse.$$
   dd bs=1 seek=128K of=$t < /dev/null 2> /dev/null
-  set x `du -sk $t`
+  set x $(du -sk $t)
   kb_size=$2
   rm -f $t
   if test $kb_size -ge 128; then
@@ -447,7 +447,7 @@ working_umask_or_skip_()
   umask 022
   touch file1 file2
   chmod 644 file2
-  perms=`ls -l file1 file2 | sed 's/ .*//' | uniq`
+  perms=$(ls -l file1 file2 | sed 's/ .*//' | uniq)
   rm -f file1 file2
 
   case $perms in
@@ -463,7 +463,7 @@ working_umask_or_skip_()
 # an initial delay of .1 second and call it at most 6 times
 # with a max delay of 3.2s (doubled each time), or a total of 6.3s
 # Note ensure you do _not_ quote the parameter to GNU sleep in
-# your function, as it may contain separate values that `sleep`
+# your function, as it may contain separate values that sleep
 # needs to accumulate.
 retry_delay_()
 {
index 722a947c08cc23021754b446f20d6876f7ed743f..aa80fcf33942793c98eaf42a1057060b24d3d1cb 100755 (executable)
@@ -57,7 +57,7 @@ ginstall -s -c -m 555 $dd $dir || fail=1
 test -f $dd || fail=1
 
 # Make sure that the destination file has the requested permissions.
-mode=`ls -l $dir/$dd|cut -b-10`
+mode=$(ls -l $dir/$dd|cut -b-10)
 test "$mode" = -r-xr-xr-x || fail=1
 
 # These failed in coreutils CVS from 2004-06-25 to 2004-08-11.
@@ -72,7 +72,7 @@ test -d newdir3 || fail=1
 # This fails because mkdir-p.c's make_dir_parents fails to return to its
 # initial working directory ($iwd) after creating the first argument, and
 # hence cannot do anything meaningful with the following relative-named dirs.
-iwd=`pwd`
+iwd=$(pwd)
 mkdir sub || fail=1
 (cd sub &&
  chmod 0 . &&
index 79cea5f7cb6ec852ad9ece2aa019e7b2955daa42..e3ccf54ac01739a61bcc08a224e2b619ef89dfce 100755 (executable)
@@ -24,7 +24,7 @@ print_ver_ ginstall
 # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
 (
   # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
-  sig=`"$abs_top_builddir/src/kill" -l CHLD 2>/dev/null` && trap '' $sig
+  sig=$("$abs_top_builddir/src/kill" -l CHLD 2>/dev/null) && trap '' $sig
 
   # Before 2004-04-21, install would infloop, in the 'while (wait...' loop:
   exec ginstall -s "$abs_top_builddir/src/ginstall$EXEEXT" .
index 044b10c0dfca82a808c686e0cf6fbcf946d40c50..358b93008a521f8261e17a05d1bcaaef296077e9 100755 (executable)
@@ -30,7 +30,7 @@ ln -s -L -P symlink2 symlink3 || fail=1
 # ===================================================
 # ensure that -L follows symlinks, and overrides -P
 ln -P -L symlink3 hard-to-a || fail=1
-ls=`ls -lG hard-to-a`x
+ls=$(ls -lG hard-to-a)x
 case "$ls" in
   *'hard-to-ax') ;;
   *'hard-to-a -> '*x) fail=1 ;;
@@ -40,7 +40,7 @@ esac
 # ===================================================
 # ensure that -P links (or at least duplicates) symlinks, and overrides -L
 ln -L -P symlink3 hard-to-3 || fail=1
-ls=`ls -lG hard-to-3`x
+ls=$(ls -lG hard-to-3)x
 case "$ls" in
   *'hard-to-3 -> symlink2x') ;;
   *'hard-to-3x') fail=1 ;;
@@ -52,7 +52,7 @@ esac
 # Create a hard link to a dangling symlink.
 ln -s /no-such-dir || framework_failure_
 ln -L no-such-dir hard-to-dangle 2>err && fail=1
-case `cat err` in
+case $(cat err) in
   *" accessing 'no-such-dir'":*) ;;
   *) fail=1 ;;
 esac
@@ -63,12 +63,12 @@ ln -P no-such-dir hard-to-dangle || fail=1
 mkdir d || framework_failure_
 ln -s d link-to-dir || framework_failure_
 ln -L link-to-dir hard-to-dir-link 2>err && fail=1
-case `cat err` in
+case $(cat err) in
   *": 'link-to-dir': hard link not allowed for directory"*) ;;
   *) fail=1 ;;
 esac
 ln -P link-to-dir/ hard-to-dir-link 2>err && fail=1
-case `cat err` in
+case $(cat err) in
   *": 'link-to-dir/': hard link not allowed for directory"*) ;;
   *) fail=1 ;;
 esac
index 09baa2645ac46e03205db2bc984612d20902bd87..4da0eda45393a8a8211b35c8ff02175b72763bac 100755 (executable)
@@ -91,7 +91,7 @@ rm -rf $d $f $ld || framework_failure_
 touch $f || framework_failure_
 mkdir $d || framework_failure_
 ln -s $d $ld
-af=`pwd`/$f
+af=$(pwd)/$f
 ln --no-dereference -fs "$af" $ld || fail=1
 test -f $ld || fail=1
 rm -rf $d $f $ld
index e7b680b5d128241d5ec18dbacbd12b915f8012dc..824c22432245d7119d331f144429272fa1443983 100755 (executable)
@@ -23,7 +23,7 @@ echo foo > a || framework_failure_
 ln -s . b || framework_failure_
 
 ln -sf a b > err 2>&1 && fail=1
-case `cat err` in
+case $(cat err) in
   *'are the same file') ;;
   *) fail=1 ;;
 esac
index b5c881e27cbf93574608369c3b726f552c177d75..8bf5ba1534f9b39aea3740bbf041d071fa07085e 100755 (executable)
@@ -25,17 +25,17 @@ ln -s f slink || framework_failure_
 
 # When listed explicitly:
 
-set x `ls -Ci f slink`; shift
+set x $(ls -Ci f slink); shift
 test $# = 4 || fail=1
 # The inode numbers should differ.
 test "$1" != "$3" || fail=1
 
-set x `ls -CLi f slink`; shift
+set x $(ls -CLi f slink); shift
 test $# = 4 || fail=1
 # With -L, they must be the same.
 test "$1" = "$3" || fail=1
 
-set x `ls -CHi f slink`; shift
+set x $(ls -CHi f slink); shift
 test $# = 4 || fail=1
 # With -H, they must be the same, too, from the command line.
 # Note that POSIX says -H must make ls dereference only
@@ -47,17 +47,17 @@ test "$1" = "$3" || fail=1
 
 # When listed from a directory:
 
-set x `ls -Ci`; shift
+set x $(ls -Ci); shift
 test $# = 4 || fail=1
 # The inode numbers should differ.
 test "$1" != "$3" || fail=1
 
-set x `ls -CLi`; shift
+set x $(ls -CLi); shift
 test $# = 4 || fail=1
 # With -L, they must be the same.
 test "$1" = "$3" || fail=1
 
-set x `ls -CHi`; shift
+set x $(ls -CHi); shift
 test $# = 4 || fail=1
 # With -H, they must be different from inside a directory.
 test "$1" != "$3" || fail=1
index 6cd18687381e94189c30996806eb51e497e5dfd4..1c8c4718f36bf0bccfb921b989363540faef67a5 100755 (executable)
@@ -34,7 +34,7 @@ touch f || framework_failure_
 chown $nameless_uid f || framework_failure_
 
 
-set -- `ls -o f` || fail=1
+set -- $(ls -o f) || fail=1
 test $3 = $nameless_uid || fail=1
 
 Exit $fail
index 733ce38a08411fd5243c0510b8801e1f7053213f..b84d5d51ab380a942bc855fd7e8078e5d30b9711 100755 (executable)
@@ -29,7 +29,7 @@ print_ver_ ls
 # but if ls's d_type code is buggy then "ls -p" might be buggy too.
 mkdir -p c/d || framework_failure_
 chmod a-x c || framework_failure_
-if test "X`ls -p c 2>&1`" != Xd/; then
+if test "X$(ls -p c 2>&1)" != Xd/; then
   skip_ "'.' is not on a suitable file system for this test"
 fi
 
index 60d96220ac7cb27e21246571bc643e00f0aa82e1..1dd6e6621c442e853425052bc82aac8f458b17d0 100755 (executable)
 print_ver_ ls
 
 
-root_dev_ino=`stat --format=%d-%i /`
-t=`pwd`
+root_dev_ino=$(stat --format=%d-%i /)
+t=$(pwd)
 while :; do
   ls -i1 "$t" > tmp
   if test $? = 0; then
     # Extract the inode number from the first line of output from ls -i1.
     # This value comes from dirent.d_ino, on systems with d_ino support.
-    d_ino=`sed -n '1s/^ *\([0-9][0-9]*\) .*/\1/p;q' tmp`
+    d_ino=$(sed -n '1s/^ *\([0-9][0-9]*\) .*/\1/p;q' tmp)
 
     # Extract the name of the corresponding directory entry.
-    file=`sed -n '1s/^ *[0-9][0-9]*  *//p;q' tmp`
+    file=$(sed -n '1s/^ *[0-9][0-9]*  *//p;q' tmp)
 
     # Get its inode number (stat.st_ino) via stat(1)'s call to lstat.
-    st_ino=`stat --format=%i "$t/$file"`
+    st_ino=$(stat --format=%i "$t/$file")
 
     # Make sure that they are the same.
     # We know from experience that there may be mismatches on some
@@ -53,7 +53,7 @@ while :; do
   fi
 
   t=$(cd "$t/.."; pwd)
-  dev_ino=`stat --format=%d-%i "$t"`
+  dev_ino=$(stat --format=%d-%i "$t")
   test $dev_ino = $root_dev_ino && break
 done
 
index 4bbf6f79c84e44a413ac9a31cb0bd3b696efc34b..28c7d32b2730a2456c76c9b5fbf37f17954a1a4b 100755 (executable)
@@ -22,7 +22,7 @@ print_ver_ ls
 mkdir dir || framework_failure_
 ln -s dir symlink || framework_failure_
 
-set `ls -l symlink/`
+set $(ls -l symlink/)
 
 # Prior to fileutils-4.0k, the following would have output '... symlink -> dir'.
 test "$*" = 'total 0' && : || fail=1
index 8af84c214e232971e43bb1887bfb154e52ec3fc5..8584dfea4c286707455cae69f61e059bb44704a9 100755 (executable)
@@ -49,7 +49,7 @@ if "$p/src/test" -w /dev/stdout >/dev/null &&
   rm -Rf tmpfile-?????? || fail=1
   mktemp tmpfile-XXXXXX >&- 2>/dev/null && fail=1
   mktemp tmpfile-XXXXXX -q >&- 2>/dev/null && fail=1
-  case `echo tmpfile-??????` in 'tmpfile-??????') ;; *) fail=1 ;; esac
+  case $(echo tmpfile-??????) in 'tmpfile-??????') ;; *) fail=1 ;; esac
 fi
 
 # Likewise for /dev/full, if /dev/full works.
@@ -59,7 +59,7 @@ if test -w /dev/full && test -c /dev/full; then
   rm -Rf tmpdir-?????? || fail=1
   mktemp -d tmpdir-XXXXXX >/dev/full 2>/dev/null && fail=1
   mktemp -d -q tmpdir-XXXXXX >/dev/full 2>/dev/null && fail=1
-  case `echo tmpfile-??????` in 'tmpfile-??????') ;; *) fail=1 ;; esac
+  case $(echo tmpfile-??????) in 'tmpfile-??????') ;; *) fail=1 ;; esac
 fi
 
 Exit $fail
index 817e9243fe351e64b3b60dd280a6b430c8a2b768..df77fe7bd2f7779fcfe4f3e8bf87f7dfd2b3feb1 100755 (executable)
@@ -24,13 +24,13 @@ print_ver_ date
 
 
 # It would be easier simply to sleep for two seconds between two runs
-# of `date --date="21:04 +0100" +%S` and ensure that both outputs
+# of $(date --date="21:04 +0100" +%S) and ensure that both outputs
 # are '00', but I prefer not to sleep unconditionally.  'make check'
 # takes long enough as it is.
 
 n=0
 # See if the current number of seconds is '00' or just before.
-s=`date +%S`
+s=$(date +%S)
 case "$s" in
   58) n=3;;
   59) n=2;;
@@ -40,7 +40,7 @@ esac
 # If necessary, wait for the system clock to pass the minute mark.
 test $n = 0 || sleep $n
 
-s=`date --date="21:04 +0100" +%S`
+s=$(date --date="21:04 +0100" +%S)
 case "$s" in
   00) ;;
   *) fail=1;;
index fe5be3f3f41b0623f971d7735ff42eb887803f3a..4fc626e8fb67d3bb98a1fb8bb60c33a329e07bb0 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ df
 
-case `df .` in
+case $(df .) in
 *'
 '*) ;;
 *) fail=1;;
index ec9f0af1e6ec68f949c4e48a4e41b4da322a7fce..6f8c064ce1f24a7e4acf234830be64b8667604d4 100755 (executable)
@@ -95,8 +95,8 @@ echo pass
 EOF
 chmod +x unlikely_name/also_unlikely || framework_failure_
 env also_unlikely && fail=1
-test x`PATH=$PATH:unlikely_name env also_unlikely` = xpass || fail=1
-test x`env PATH="$PATH":unlikely_name also_unlikely` = xpass || fail=1
+test x$(PATH=$PATH:unlikely_name env also_unlikely) = xpass || fail=1
+test x$(env PATH="$PATH":unlikely_name also_unlikely) = xpass || fail=1
 
 # Explicitly put . on the PATH for the rest of this test.
 PATH=$PATH:
@@ -108,15 +108,15 @@ export PATH
 # Avoid the issue by using an executable rather than a script.
 # Test -u, rather than -i, to minimize PATH problems.
 ln -s "$abs_top_builddir/src/echo" ./-u || framework_failure_
-case `env -u echo echo good` in
+case $(env -u echo echo good) in
   good) ;;
   *) fail=1 ;;
 esac
-case `env -u echo -- echo good` in
+case $(env -u echo -- echo good) in
   good) ;;
   *) fail=1 ;;
 esac
-case `env -- -u pass` in
+case $(env -- -u pass) in
   pass) ;;
   *) fail=1 ;;
 esac
@@ -125,7 +125,7 @@ esac
 env a=b -- true
 test $? = 127 || fail=1
 ln -s "$abs_top_builddir/src/echo" ./-- || framework_failure_
-case `env a=b -- true || echo fail` in
+case $(env a=b -- true || echo fail) in
   true) ;;
   *) fail=1 ;;
 esac
@@ -136,9 +136,9 @@ cat <<EOF >./c=d || framework_failure_
 echo pass
 EOF
 chmod +x c=d || framework_failure_
-test "x`env c=d echo fail`" = xfail || fail=1
-test "x`env -- c=d echo fail`" = xfail || fail=1
-test "x`env ./c=d echo fail`" = xfail || fail=1
+test "x$(env c=d echo fail)" = xfail || fail=1
+test "x$(env -- c=d echo fail)" = xfail || fail=1
+test "x$(env ./c=d echo fail)" = xfail || fail=1
 test "x$(env sh -c 'exec "$@"' sh c=d echo fail)" = xpass || fail=1
 test "x$(sh -c '\c=d echo fail')" = xpass && #dash 0.5.4 fails so check first
   { test "x$(env sh -c '\c=d echo fail')" = xpass || fail=1; }
index 8a768a42a78e5317295c1c284a0e66f49d970a42..32f86d2f36e61b08224a2ebebe475f8ea7a643dc 100755 (executable)
@@ -22,7 +22,7 @@ print_ver_ head
 echo abc > in || framework_failure_
 
 (head -c1; head -c1) < in > out || fail=1
-case "`cat out`" in
+case "$(cat out)" in
   ab) ;;
   *) fail=1 ;;
 esac
index a998294801411754d989b7bc32f9882cc6b7187f..7bc3c642b5e306fa222cc11bd67796df145476fb 100755 (executable)
@@ -47,7 +47,7 @@ touch -a -d "$u1" a || framework_failure_
 
 
 # A has ctime more recent than C.
-set `ls -c a c`
+set $(ls -c a c)
 test "$*" = 'a c' || fail=1
 
 # Sleep so long in an attempt to avoid spurious failures
@@ -58,7 +58,7 @@ sleep 2
 ln c d || framework_failure_
 
 # Before we go any further, verify that touch's -m option works.
-set -- `ls --full -l a`
+set -- $(ls --full -l a)
 case "$*" in
   *" $t3:00.000000000 +0000 a") ;;
   *)
@@ -77,7 +77,7 @@ EOF
 esac
 
 # Ensure that touch's -a option works.
-set -- `ls --full -lu a`
+set -- $(ls --full -lu a)
 case "$*" in
   *" $u1:00.000000000 +0000 a") ;;
   *)
@@ -94,16 +94,16 @@ EOF
   ;;
 esac
 
-set `ls -ut a b c`
+set $(ls -ut a b c)
 test "$*" = 'c b a' && : || fail=1
 test $fail = 1 && ls -l --full-time --time=access a b c
 
-set `ls -t a b c`
+set $(ls -t a b c)
 test "$*" = 'a b c' && : || fail=1
 test $fail = 1 && ls -l --full-time a b c
 
 # Now, C should have ctime more recent than A.
-set `ls -ct a c`
+set $(ls -ct a c)
 if test "$*" = 'c a'; then
   : ok
 else
index 09334b82607c5905d61a0537c8d4c01f513dc0c8..b9e33ad2d45a9f6e67e3a576c3cbf37b2da73675 100755 (executable)
@@ -25,15 +25,15 @@ mkfifo_or_skip_ fifo
 umask 777
 
 mknod  -m 734 f1 p || fail=1
-mode=`ls -dgo f1|cut -b-10`
+mode=$(ls -dgo f1|cut -b-10)
 test $mode = prwx-wxr-- || fail=1
 
 mkfifo -m 734 f2   || fail=1
-mode=`ls -dgo f2|cut -b-10`
+mode=$(ls -dgo f2|cut -b-10)
 test $mode = prwx-wxr-- || fail=1
 
 mkdir -m 734 f3   || fail=1
-mode=`ls -dgo f3|cut -b-10`
+mode=$(ls -dgo f3|cut -b-10)
 test $mode = drwx-wxr-- || test $mode = drwx-wsr-- || fail=1
 
 Exit $fail
index cbc135fda9dc4092f9d906e85d0f19a050a8bc8f..ac8ea04ea4e64ac5c73a1702ac342fbebb446b41 100755 (executable)
@@ -45,7 +45,7 @@ NA LAST NA
 set $tests
 
 # Require that this test be run at 'nice' level 0.
-niceness=`nice`
+niceness=$(nice)
 if test "$niceness" = 0; then
     : ok
 else
@@ -58,19 +58,19 @@ while :; do
   expected_result=$3
   test $args = empty && args=''
   test x$args = xLAST && break
-  args=`echo x$args|tr : ' '|sed 's/^x//'`
+  args=$(echo x$args|tr : ' '|sed 's/^x//')
   if test "$VERBOSE" = yes; then
-    #echo "testing \`nice $args nice\` = $expected_result ..."
+    #echo "testing \$(nice $args nice\) = $expected_result ..."
     echo "test $test_name... " | tr -d '\n'
   fi
-  test x`nice $args nice 2> /dev/null` = x$expected_result \
+  test x$(nice $args nice 2> /dev/null) = x$expected_result \
     && ok=ok || ok=FAIL fail=1
   test "$VERBOSE" = yes && echo $ok
   shift; shift; shift
 done
 
 # Test negative niceness - command must be run whether or not change happens.
-if test x`nice -n -1 nice 2> /dev/null` = x0 ; then
+if test x$(nice -n -1 nice 2> /dev/null) = x0 ; then
   # unprivileged user - warn about failure to change
   nice -n -1 true 2> err || fail=1
   test -s err || fail=1
@@ -87,8 +87,8 @@ else
   # superuser - change succeeds
   nice -n -1 nice 2> err || fail=1
   test -s err && fail=1
-  test x`nice -n -1 nice` = x-1 || fail=1
-  test x`nice --1 nice` = x-1 || fail=1
+  test x$(nice -n -1 nice) = x-1 || fail=1
+  test x$(nice --1 nice) = x-1 || fail=1
 fi
 
 Exit $fail
index cef8ee8fcfc9f171cfc4a484e8e0a53da5dd26a4..76f676d81ed704a7a7c6965f0aff1ed3773fbad8 100755 (executable)
@@ -25,7 +25,7 @@ nohup sh -c 'echo stdout; echo stderr 1>&2' 2>err || fail=1
 # Be careful.  The results of the above nohup command
 # change depending on whether stdin and stdout are redirected.
 if test -t 1; then
-  test "`cat nohup.out`" = stdout || fail=1
+  test "$(cat nohup.out)" = stdout || fail=1
   if test -t 0; then
     echo 'nohup: ignoring input and appending output to 'nohup.out'\'
   else
index 1f607bc87e7a9bec96ae4321b7a39b8f666ceb21..049273cdf750fdbf40ab2abf64750a6286c4ff83 100755 (executable)
@@ -23,17 +23,17 @@ print_ver_ od
 # Choose 48 bytes for the input, as that is lcm for 1, 2, 4, 8, 12, 16;
 # we don't anticipate any other native object size on modern hardware.
 seq 19 > in || framework_failure_
-test `wc -c < in` -eq 48 || framework_failure_
+test $(wc -c < in) -eq 48 || framework_failure_
 
 
 list='a c dC dS dI dL oC oS oI oL uC uS uI uL xC xS xI xL fF fD fL'
 for format1 in $list; do
   for format2 in $list; do
     od -An -t${format1}z -t${format2}z in > out-raw || fail=1
-    linewidth=`head -n1 out-raw | wc -c`
-    linecount=`wc -l < out-raw`
-    echo $format1 $format2 `wc -c < out-raw` >> out
-    echo $format1 $format2 `expr $linewidth '*' $linecount` >> exp
+    linewidth=$(head -n1 out-raw | wc -c)
+    linecount=$(wc -l < out-raw)
+    echo $format1 $format2 $(wc -c < out-raw) >> out
+    echo $format1 $format2 $(expr $linewidth '*' $linecount) >> exp
   done
 done
 
index 6f282d9c02daee9c7496bf9025d509bd11b2ad71..351896ef83592d2cbdb5491d87a95d6d7d4089c6 100755 (executable)
@@ -33,7 +33,7 @@ runcon $(id -Z) true -j 2> out && : > exp
 # it chcon fails with this: "runcon: invalid context: \
 # root:system_r:unconfined_t:s0-s0:c0.c1023: No such file or directory"
 # That diagnostic is ok, too, so map it to the more common one.
-case `cat out` in
+case $(cat out) in
   'runcon: invalid context: '*) echo "$diag" > out;;
 esac
 
index 810996c8793b0c2a1cc09fb42bcf9e400f48530b..12ae15f4ed454d0b58b8abd68086aee2c1d31cc6 100755 (executable)
@@ -37,23 +37,23 @@ chcon $ctx f d p ||
 
 # inspect that context with both ls -Z and stat.
 for i in d f p; do
-  c=`ls -dogZ $i|cut -d' ' -f3`; test x$c = x$ctx || fail=1
-  c=`stat --printf %C $i`; test x$c = x$ctx || fail=1
+  c=$(ls -dogZ $i|cut -d' ' -f3); test x$c = x$ctx || fail=1
+  c=$(stat --printf %C $i); test x$c = x$ctx || fail=1
 done
 
 # ensure that ls -l output includes the ".".
-c=`ls -l f|cut -c11`; test "$c" = . || fail=1
+c=$(ls -l f|cut -c11); test "$c" = . || fail=1
 
 # Copy each to a new directory and ensure that context is preserved.
 cp -r --preserve=all d f p s1 || fail=1
 for i in d f p; do
-  c=`stat --printf %C s1/$i`; test x$c = x$ctx || fail=1
+  c=$(stat --printf %C s1/$i); test x$c = x$ctx || fail=1
 done
 
 # Now, move each to a new directory and ensure that context is preserved.
 mv d f p s2 || fail=1
 for i in d f p; do
-  c=`stat --printf %C s2/$i`; test x$c = x$ctx || fail=1
+  c=$(stat --printf %C s2/$i); test x$c = x$ctx || fail=1
 done
 
 Exit $fail
index 8fdbdd9f25dc78b75deac7c449062a7eaec7514e..243c0498d30ce4ded47efa175652cde9425ed3fa 100755 (executable)
@@ -40,7 +40,7 @@ sort -n out > out1
 compare in out1 || { fail=1; echo "not a permutation" 1>&2; }
 
 # Exercise shuf's -e option.
-t=`shuf -e a b c d e | sort | fmt`
+t=$(shuf -e a b c d e | sort | fmt)
 test "$t" = 'a b c d e' || { fail=1; echo "not a permutation" 1>&2; }
 
 # Before coreutils-6.3, this would infloop.
index 9a4b9f6224f3d6b57ce11c4bb02f5afb44af0ea7..00dcf06aca496ada1dc8f29f191d804a751d33ad 100755 (executable)
@@ -39,7 +39,7 @@ chmod +x gzip
 # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
 (
   # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
-  sig=`"$abs_top_builddir/src/kill" -l CHLD 2>/dev/null` && trap '' $sig
+  sig=$("$abs_top_builddir/src/kill" -l CHLD 2>/dev/null) && trap '' $sig
 
   # This should force the use of child processes for "compression"
   PATH=.:$PATH exec sort -S 1k --compress-program=gzip in > /dev/null
index d206494a17d496cc5656a4c2b2df379b475f5b75..7ce109c1a4fca688709e5689aedec7bb105676d3 100755 (executable)
@@ -24,7 +24,7 @@ require_ulimit_
 mkdir in err || framework_failure_
 
 
-for i in `seq 17`; do
+for i in $(seq 17); do
   echo $i >in/$i
 done
 seq 17 >some-data
index c9fce0aa7faeb5b582ce07e2cb3cb9fb31a3a756..79730e9578fe30e2d0f4287ea84d44d4bdab34e2 100755 (executable)
@@ -35,7 +35,7 @@ compare in out1 || { fail=1; echo "not a permutation" 1>&2; }
 
 # If locale is available then use it to find a random non-C locale.
 if (locale --version) > /dev/null 2>&1; then
-  locale=`locale -a | sort --random-sort | awk '/^.._/{print;exit}'`
+  locale=$(locale -a | sort --random-sort | awk '/^.._/{print;exit}')
   LC_ALL=$locale sort --random-sort in > out1 || fail=1
   LC_ALL=$locale sort --random-sort in > out2 || fail=1
 
index af428151ffe85a9446ed362ba25e20b036dc7751..8952a7abb00189d7bfaba0c0a003068ecc2a2d54 100755 (executable)
@@ -21,9 +21,9 @@ print_ver_ stat
 
 
 
-for i in `seq 50`; do
-  fmt=`printf "%${i}s" %`
-  out=`stat --form="$fmt" .`
+for i in $(seq 50); do
+  fmt=$(printf "%${i}s" %)
+  out=$(stat --form="$fmt" .)
   test "$out" = "$fmt" || fail=1
 done
 
index 650231f16191f32b89e6095c44e538e03b290477..97020e8fee0e724576e5b023f493e1e4495c8639 100755 (executable)
@@ -40,7 +40,7 @@ REV_cbreak=1 REV_decctlq=1 REV_tabs=1 REV_lcase=1 REV_LCASE=1
 
 saved_state=.saved-state
 stty --save > $saved_state || fail=1
-stty `cat $saved_state` || fail=1
+stty $(cat $saved_state) || fail=1
 
 # This would segfault prior to sh-utils-2.0j.
 stty erase - || fail=1
@@ -54,7 +54,7 @@ stty -raw -a 2>/dev/null && fail=1
 # Don't depend on terminal width.  Put each option on its own line,
 # remove all non-boolean ones, then remove any leading hyphens.
 sed_del='/^speed/d;/^rows/d;/^columns/d;/ = /d'
-options=`stty -a | tr -s ';' '\n' | sed "s/^ //;$sed_del;s/-//g"`
+options=$(stty -a | tr -s ';' '\n' | sed "s/^ //;$sed_del;s/-//g")
 
 # Take them one at a time, with and without the leading '-'.
 for opt in $options; do
@@ -70,7 +70,7 @@ for opt in $options; do
 
   # Likewise, 'stty -cread' would fail, so skip that, too.
   test $opt = cread && continue
-  rev=`eval echo "\\\$REV_$opt"`
+  rev=$(eval echo "\$REV_$opt")
   if test -n "$rev"; then
     stty -$opt || { fail=1; echo -$opt; }
   fi
@@ -84,8 +84,8 @@ if test -n "$RUN_LONG_TESTS"; then
 
       stty $opt1 $opt2 || fail=1
 
-      rev1=`eval echo "\\\$REV_$opt1"`
-      rev2=`eval echo "\\\$REV_$opt2"`
+      rev1=$(eval echo "\$REV_$opt1")
+      rev2=$(eval echo "\$REV_$opt2")
       if test -n "$rev1"; then
         stty -$opt1 $opt2 || fail=1
       fi
@@ -99,6 +99,6 @@ if test -n "$RUN_LONG_TESTS"; then
   done
 fi
 
-stty `cat $saved_state`
+stty $(cat $saved_state)
 
 Exit $fail
index 2be98437ea372c9076114b3da95d6bf4b47a19b3..3b035ecefbe132513d27ef6af9a39b461c9a1d75 100755 (executable)
@@ -22,7 +22,7 @@ require_controlling_input_terminal_
 trap '' TTOU # Ignore SIGTTOU
 
 
-saved_state=`stty -g` || fail=1
+saved_state=$(stty -g) || fail=1
 stty $saved_state || fail=1
 
 # Before coreutils-6.9.90, if stty were given an argument with 35 colons
@@ -34,8 +34,8 @@ stty $saved_state || fail=1
 # For each of the following, with coreutils-6.9 and earlier,
 # stty would fail to diagnose the error on at least Solaris 10.
 hex_2_64=10000000000000000
-stty `echo $saved_state |sed 's/^[^:]*:/'$hex_2_64:/`     2>/dev/null && fail=1
-stty `echo $saved_state |sed 's/:[0-9a-f]*$/:'$hex_2_64/` 2>/dev/null && fail=1
+stty $(echo $saved_state |sed 's/^[^:]*:/'$hex_2_64:/)     2>/dev/null && fail=1
+stty $(echo $saved_state |sed 's/:[0-9a-f]*$/:'$hex_2_64/) 2>/dev/null && fail=1
 
 # Just in case either of the above mistakenly succeeds (and changes
 # the state of our tty), try to restore the initial state.
index bcbc7bc64d77f0ec69b912d35fa319f480166367..d7151d5b7c6d301f7b7f9970ac1b952d3fc2537f 100755 (executable)
@@ -51,7 +51,7 @@ NA LAST NA
 '
 set $tests
 
-saved_size=`stty size` && test -n "$saved_size" \
+saved_size=$(stty size) && test -n "$saved_size" \
   || skip_ "can't get window size"
 
 # Linux virtual consoles issue an error if you
@@ -66,16 +66,16 @@ fi
 while :; do
   test_name=$1
   args=$2
-  expected_result="`echo $3|tr _ ' '`"
+  expected_result="$(echo $3|tr _ ' ')"
   test "$args" = empty && args=''
   test "x$args" = xLAST && break
-  args=`echo x$args|tr _ ' '|sed 's/^x//'`
+  args=$(echo x$args|tr _ ' '|sed 's/^x//')
   if test "$VERBOSE" = yes; then
-    # echo "testing \`stty $args; stty size\` = $expected_result ..."
+    # echo "testing \$(stty $args; stty size\) = $expected_result ..."
     echo "test $test_name... " | tr -d '\n'
   fi
   stty $args || exit 1
-  test x"`stty size 2> /dev/null`" = "x$expected_result" \
+  test x"$(stty size 2> /dev/null)" = "x$expected_result" \
     && ok=ok || ok=FAIL fail=1
   test "$VERBOSE" = yes && echo $ok
   shift; shift; shift
index 8607c612c04ef3a5f3c38b5d604e76ff5faa7804..4c17316d3b503d9e6bff859a1f1137eb101923f9 100755 (executable)
 print_ver_ tee
 
 echo line >sample || framework_failure_
-nums=`seq 9` || framework_failure_
+nums=$(seq 9) || framework_failure_
 
 for n in 0 $nums; do
-        files=`seq $n`
+        files=$(seq $n)
         rm -f $files
         tee $files <sample >out || fail=1
         for f in out $files; do
index d69e2f21be6c41f7b5edfdf041ce715349aae57c..5f4e9ec2a454a0bbccc4214c265225ed3c044b75 100755 (executable)
@@ -46,7 +46,7 @@ test $? = 124 && fail=1
 # Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
 (
   # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
-  sig=`"$abs_top_builddir/src/kill" -l CHLD 2>/dev/null` && trap '' $sig
+  sig=$("$abs_top_builddir/src/kill" -l CHLD 2>/dev/null) && trap '' $sig
 
   exec timeout 10 true
 ) || fail=1
index a2c41455d37ee87832cdf50e6b4f71b9d20d3b7b..cd8e6760695c17c4e6f37e39692721f999ad8303 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ mkdir
 
-mkdir --parents "`pwd`/t" || fail=1
+mkdir --parents "$(pwd)/t" || fail=1
 test -d t || fail=1
 
 Exit $fail
index 7d1d095018e46db51376caf4447654445cd377ac..d0c487ec9c96d8ce51cbb3e2d18883a3211a3a35 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ mkdir
 
-mkdir --parents "`pwd`/t/u" || fail=1
+mkdir --parents "$(pwd)/t/u" || fail=1
 test -d t/u || fail=1
 
 Exit $fail
index 90cbd9920e9ddf4d05528f82783c1a95c632e1ce..7031b2ede5ce00442643feb71d1e5109658efdd3 100755 (executable)
@@ -26,7 +26,7 @@ mkdir no-access || framework_failure_
 mkdir no-acce2s || framework_failure_
 mkdir -p no-acce3s/d || framework_failure_
 
-p=`pwd`
+p=$(pwd)
 (cd no-access && chmod 0 . && mkdir -p "$p/a/b" u/v) 2> /dev/null && fail=1
 test -d "$p/a/b" || fail=1
 
@@ -44,7 +44,7 @@ if is_local_dir_ .; then
   test -d "$p/b/c" || fail=1
 fi
 
-b=`ls "$p/a" | tr -d '\n'`
+b=$(ls "$p/a" | tr -d '\n')
 # With coreutils-5.3.0, this would fail with $b=bu.
 test "x$b" = xb || fail=1
 
index c9bf37bb02e6a309d7cebf43ad24af78cb004911..0543e675ec3e52d6ab3b8b3a125447d711ae7977 100755 (executable)
@@ -31,21 +31,21 @@ mkdir e-dir > /dev/null 2>&1 && fail=1
 # Create an existing directory.
 umask 077
 mode_str=drwxr-x-wx
-mode_arg=`rwx_to_mode_ $mode_str`
+mode_arg=$(rwx_to_mode_ $mode_str)
 mkdir -m $mode_arg a || fail=1
 
 # this 'mkdir -p ...' shouldn't change perms of existing dir 'a'.
 d_mode_str=drwx-w--wx
-d_mode_arg=`rwx_to_mode_ $d_mode_str`
+d_mode_arg=$(rwx_to_mode_ $d_mode_str)
 mkdir -p -m $d_mode_arg a/b/c/d
 
 # Make sure the permissions of 'a' haven't been changed.
-p=`ls -ld a|cut -b-10`; case $p in $mode_str);; *) fail=1;; esac
+p=$(ls -ld a|cut -b-10); case $p in $mode_str);; *) fail=1;; esac
 # 'b's and 'c's should reflect the umask
-p=`ls -ld a/b|cut -b-10`; case $p in drwx------);; *) fail=1;; esac
-p=`ls -ld a/b/c|cut -b-10`; case $p in drwx------);; *) fail=1;; esac
+p=$(ls -ld a/b|cut -b-10); case $p in drwx------);; *) fail=1;; esac
+p=$(ls -ld a/b/c|cut -b-10); case $p in drwx------);; *) fail=1;; esac
 
 # 'd's perms are determined by the -m argument.
-p=`ls -ld a/b/c/d|cut -b-10`; case $p in $d_mode_str);; *) fail=1;; esac
+p=$(ls -ld a/b/c/d|cut -b-10); case $p in $d_mode_str);; *) fail=1;; esac
 
 Exit $fail
index cabae6cc9123c4e7077f9cc22d8fe52ba2a7e087..f9b207f81044cbd40b0efe004dd2959b3e7943cc 100755 (executable)
@@ -38,7 +38,7 @@ tests='
     027  :   -m =+X   : drwxr-x--- : d--x--x--- :
     -    :   -        : last       : last       :
     '
-colon_tests=`echo $tests | sed 's/^ *//; s/ *: */:/g'`
+colon_tests=$(echo $tests | sed 's/^ *//; s/ *: */:/g')
 
 for p in empty -p; do
   test _$p = _empty && p=
index fbf3f1f7b02e75987b9ca5524aa48d60c4b79530..d478930eb73c76904a61165f2a83dccaccf01aec 100755 (executable)
@@ -26,7 +26,7 @@ tmp=t
 mkdir -m$set_mode_string $tmp || fail=1
 
 test -d $tmp || fail=1
-mode=`ls -ld $tmp|cut -b-10`
+mode=$(ls -ld $tmp|cut -b-10)
 case "$mode" in
   $output_mode_string) ;;
   *) fail=1 ;;
@@ -42,7 +42,7 @@ mkdir -m$set_mode_string $tmp2 2> /dev/null && fail=1
 mkdir --parents -m$set_mode_string $tmp2 || fail=1
 
 test -d $tmp2 || fail=1
-mode=`ls -ld $tmp2|cut -b-10`
+mode=$(ls -ld $tmp2|cut -b-10)
 case "$mode" in
   $output_mode_string) ;;
   *) fail=1 ;;
index 382752a338a8f18094207f9024f2aa087edfc51a..2354ed967b394ebd92557b0ded714c45d27e5b1b 100755 (executable)
@@ -38,30 +38,30 @@ skip_partition=none
 setfacl -m user:bin:rw- file 2> /dev/null || skip_partition=.
 # And on the destination file system.
 setfacl -m user:bin:rw- $t1 || skip_partition=$other_partition_tmpdir
-acl1=`getfacl file` || skip_partition=.
+acl1=$(getfacl file) || skip_partition=.
 
 test $skip_partition != none &&
   skip_ "'$skip_partition' is not on a suitable file system for this test"
 
 # move the access acl of a file
 mv file "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl file` || framework_failure_
+acl2=$(cd "$other_partition_tmpdir" && getfacl file) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 # move the access acl of a directory
 mkdir dir || framework_failure_
 setfacl -m user:bin:rw- dir || framework_failure_
-acl1=`getfacl dir` || framework_failure_
+acl1=$(getfacl dir) || framework_failure_
 mv dir "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl dir` || framework_failure_
+acl2=$(cd "$other_partition_tmpdir" && getfacl dir) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 # move the default acl of a directory
 mkdir dir2 || framework_failure_
 setfacl -d -m user:bin:rw- dir2 || framework_failure_
-acl1=`getfacl dir2` || framework_failure_
+acl1=$(getfacl dir2) || framework_failure_
 mv dir2 "$other_partition_tmpdir" || fail=1
-acl2=`cd "$other_partition_tmpdir" && getfacl dir2` || framework_failure_
+acl2=$(cd "$other_partition_tmpdir" && getfacl dir2) || framework_failure_
 test "$acl1" = "$acl2" || fail=1
 
 Exit $fail
index c2b38c69068819210cc3449e1514b78b407805b2..e5391c33727931c8fc7cd929d0b3dc22a72ae3d7 100755 (executable)
@@ -41,6 +41,6 @@ $EGREP 'unlink.*"s1"' out && fail=1
 ls -dl s1 > /dev/null 2>&1 && fail=1
 
 # Ensure that the destination, s2, contains the link from s1.
-test "`readlink s2`" = t1 || fail=1
+test "$(readlink s2)" = t1 || fail=1
 
 Exit $fail
index e329dba918f125c743f22b28f571a84e617723d0..d9c55e2c9bee57be8cf44cab488e1cfaebb755bb 100755 (executable)
@@ -39,7 +39,7 @@ $EGREP 'unlink.*"b"' out && fail=1
 ls -dl a > /dev/null 2>&1 && fail=1
 
 # Ensure that the destination, "b", has link count 1.
-n_links=`stat --printf=%h b` || fail=1
+n_links=$(stat --printf=%h b) || fail=1
 test "$n_links" = 1 || fail=1
 
 Exit $fail
index 04774d2942b29853edd45b001ad662ca17f5a9d8..efe7225d6112547d073d83c2869513081104e54d 100755 (executable)
@@ -32,7 +32,7 @@ cp a/f b/f c 2> /dev/null && fail=1
 test -f a/f || fail=1
 test -f b/f || fail=1
 test -f c/f || fail=1
-test "`cat c/f`" = a || fail=1
+test "$(cat c/f)" = a || fail=1
 rm -f c/f
 
 # With --backup=numbered, it should succeed
@@ -47,7 +47,7 @@ mv a/f b/f c 2> /dev/null && fail=1
 test -f a/f && fail=1
 test -f b/f || fail=1
 test -f c/f || fail=1
-test "`cat c/f`" = a || fail=1
+test "$(cat c/f)" = a || fail=1
 
 # Make sure mv still works when moving hard links.
 # This is where the same_file test is necessary, and why
@@ -76,8 +76,8 @@ echo a > a/f || fail=1
 echo b > b/f || fail=1
 ln -f a/f b/f c 2> /dev/null && fail=1
 # a/f and c/f must be linked
-test `stat --format %i a/f` = `stat --format %i c/f` || fail=1
+test $(stat --format %i a/f) = $(stat --format %i c/f) || fail=1
 # b/f and c/f must not be linked
-test `stat --format %i b/f` = `stat --format %i c/f` && fail=1
+test $(stat --format %i b/f) = $(stat --format %i c/f) && fail=1
 
 Exit $fail
index 79ff9e95ada31ce7115161575eb4b33590822bc6..6bed83bf9599c49ef385ec8d40e9fc2ae8c4b7eb 100755 (executable)
@@ -33,7 +33,7 @@ mv: '$ff' and '$ff' are the same file
 EOF
 
 compare exp out || fail=1
-test `cat $ff` = force-contents || fail=1
+test $(cat $ff) = force-contents || fail=1
 
 # This should succeed, even though the source and destination
 # device and inodes are the same.
index c1d25af0ab7de7c5d30ec00c03b481334af1e506..e0fc174f09265c1e89d120fc2617e39fcccdb514 100755 (executable)
@@ -43,9 +43,9 @@ test -f b || fail=1
 test -f c || fail=1
 
 # The three i-node numbers must be the same.
-ia=`ls -i a|sed 's/ a//'`
-ib=`ls -i b|sed 's/ b//'`
-ic=`ls -i c|sed 's/ c//'`
+ia=$(ls -i a|sed 's/ a//')
+ib=$(ls -i b|sed 's/ b//')
+ic=$(ls -i c|sed 's/ c//')
 test $ia = $ib || fail=1
 test $ia = $ic || fail=1
 
@@ -68,9 +68,9 @@ test -f b || fail=1
 test -f c || fail=1
 
 # The three i-node numbers must be the same.
-ia=`ls -i a|sed 's/ a//'`
-ib=`ls -i b|sed 's/ b//'`
-ic=`ls -i c|sed 's/ c//'`
+ia=$(ls -i a|sed 's/ a//')
+ib=$(ls -i b|sed 's/ b//')
+ic=$(ls -i c|sed 's/ c//')
 test $ia = $ib || fail=1
 test $ia = $ic || fail=1
 
index 9dd8ad592063df099d5b6f3b033cc0487c51537f..a62167a072b520b07ce5476253d644230b58114f 100755 (executable)
@@ -58,12 +58,12 @@ test -f x/b || fail=1
 test -f c || fail=1
 
 # The i-node numbers of a and c must be the same.
-ia=`ls -i a` || fail=1; set x $ia; ia=$2
-ic=`ls -i c` || fail=1; set x $ic; ic=$2
+ia=$(ls -i a) || fail=1; set x $ia; ia=$2
+ic=$(ls -i c) || fail=1; set x $ic; ic=$2
 test "$ia" = "$ic" || fail=1
 
 # The i-node number of x/b must be different.
-ib=`ls -i x/b` || fail=1; set x $ib; ib=$2
+ib=$(ls -i x/b) || fail=1; set x $ib; ib=$2
 test "$ia" = "$ib" && fail=1
 
 Exit $fail
index eccd8bcdb365337523ce999106a65d76a856e599..78a555ac9ec2e01aaa2cfdac12c798b6f786a16b 100755 (executable)
@@ -34,8 +34,8 @@ mv $dir "$other_partition_tmpdir" || fail=1
 ls -1i "$other_partition_tmpdir/$dir" > out || fail=1
 
 # Make sure the inode numbers are the same.
-a=`sed -n 's/ a$//p' out`
-b=`sed -n 's/ b$//p' out`
+a=$(sed -n 's/ a$//p' out)
+b=$(sed -n 's/ b$//p' out)
 test "$a" = "$b" || fail=1
 
 Exit $fail
index 84ccfe58b8f9396ec6b168a52c23c268a2c22efd..f24801958103c97ae8798727d4736d507695a6ef 100755 (executable)
@@ -35,7 +35,7 @@ mv -fi c d < y >/dev/null 2>&1 || fail=1
 cp -if e f < y > out 2>&1 || fail=1
 
 # Make sure out contains the prompt.
-case "`cat out`" in
+case "$(cat out)" in
   "cp: try to overwrite 'f', overriding mode 0000 (---------)?"*) ;;
   *) fail=1 ;;
 esac
index 262b5ba04ff7e215f8c6ea98bf56a9a8483ce3d6..3912842a20aeab8addb63a60669b9cfc3bd6112a 100755 (executable)
@@ -45,7 +45,7 @@ mv f g < $tty > out 2>&1 & pid=$!
 check_overwrite_prompt()
 {
   local delay="$1"
-  case "`cat out`" in
+  case "$(cat out)" in
     "mv: try to overwrite 'g', overriding mode 0000"*) ;;
     *) sleep $delay; return 1;;
   esac
@@ -61,7 +61,7 @@ test -f i || fail=1
 test -f h && fail=1
 
 # Make sure there was no prompt.
-case "`cat out`" in
+case "$(cat out)" in
   '') ;;
   *) fail=1 ;;
 esac
index bcf3fdda29ba47a2c5a23679ca19670e638f8443..8ef6ca77b8f8682a882f0fa739b0f2cb9d92cf6d 100755 (executable)
@@ -27,7 +27,7 @@ echo y > y || framework_failure_
 mv -i a b < y >/dev/null 2>&1 || fail=1
 
 # Make sure out contains the prompt.
-case "`cat b`" in
+case "$(cat b)" in
   a) ;;
   *) fail=1 ;;
 esac
index a37a1ffba4030b837cd1265ae0a59be845acbdc0..4615eaabb0f0fbd582a6a3eb69aa298eb6808e1d 100755 (executable)
@@ -35,7 +35,7 @@ touch exp_err
 compare exp out || fail=1
 compare exp_err err || fail=1
 
-case "`cat b/foo`" in
+case "$(cat b/foo)" in
   foo) ;;
   *) fail=1;;
 esac
index 532bdb0822e4559a3427d14b68335cd4a5e7a7d0..d349a3f11ce986cecdd331c037562cce40fcd38e 100755 (executable)
@@ -32,16 +32,16 @@ b="0 1 2 3 4 5 6 7 8 9
 a b c d e f g h i j k l m n o p q r s t u v w x y z
 _A _B _C _D _E _F _G _H _I _J _K _L _M _N _O _P _Q _R _S _T _U _V _W _X _Y _Z"
 
-for i in `echo $b`; do
+for i in $(echo $b); do
   echo $i
   for j in $b; do
     echo $i$j
   done
 done > .dirs
-mkdir `cat .dirs` || framework_failure_
+mkdir $(cat .dirs) || framework_failure_
 sed 's,$,/f,' .dirs | xargs touch
 
-last_file=`tail -n1 .dirs`/f
+last_file=$(tail -n1 .dirs)/f
 test -f $last_file || framework_failure_
 
 
index ac71bdf7227850f6952d62a0f1683588484e7794..af773a23bc851873fd2a9a822c6e5ddf9e210621 100755 (executable)
@@ -35,9 +35,9 @@ mv f g "$other_partition_tmpdir" || fail=1
 mv a b "$other_partition_tmpdir" || fail=1
 
 cd "$other_partition_tmpdir"
-set `ls -Ci f g`
+set $(ls -Ci f g)
 test $1 = $3 || fail=1
-set `ls -Ci a/1 b/1`
+set $(ls -Ci a/1 b/1)
 test $1 = $3 || fail=1
 
 Exit $fail
index 30cb4400e5147f71829568b13ad85142f8688032..2e7cf1b8bbf26b9c607fa47f044c8490dc262e01 100755 (executable)
@@ -27,7 +27,7 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 # mv: preserving permissions for 'rem_sl': Operation not supported
 require_local_dir_
 
-pwd_tmp=`pwd`
+pwd_tmp=$(pwd)
 
 # Unset CDPATH.  Otherwise, output from the 'cd dir' command
 # can make this test fail.
@@ -68,15 +68,15 @@ for copy in cp mv; do
       rm -f "$other_partition_tmpdir"/* || fail=1
       mkdir dir || fail=1
       cd dir || fail=1
-      case "$args" in *loc_reg*) reg_abs="`pwd`/$loc_reg" ;; esac
+      case "$args" in *loc_reg*) reg_abs="$(pwd)/$loc_reg" ;; esac
       case "$args" in *rem_reg*) reg_abs=$rem_reg ;; esac
       case "$args" in *loc_sl*) slink=$loc_sl ;; esac
       case "$args" in *rem_sl*) slink=$rem_sl ;; esac
 
       echo $contents > "$reg_abs" || fail=1
       ln -nsf "$reg_abs" $slink || fail=1
-      actual_args=`echo $args|sed 's,^,$,;s/ / $/'`
-      actual_args=`eval echo $actual_args`
+      actual_args=$(echo $args|sed 's,^,$,;s/ / $/')
+      actual_args=$(eval echo $actual_args)
 
       (
         (
@@ -115,7 +115,7 @@ for copy in cp mv; do
             for f in $actual_args; do
               test -f $f ||
                 { echo " $copy FAILED but removed $f"; continue; }
-              case "`cat $f`" in
+              case "$(cat $f)" in
                 "$contents") ;;
                 *) echo " $copy FAILED but modified $f";;
               esac
@@ -130,7 +130,7 @@ for copy in cp mv; do
                 if test $copy_status != 0; then
                   test
                 fi
-                case "`cat $f`" in
+                case "$(cat $f)" in
                   "$contents") ;;
                   *) echo " $copy FAILED";;
                 esac
index 65ae5d024f97b41054ee374fa6f025be742c524d..bbda9da7a545146ca8ada30ddd0a38cb9201a705 100755 (executable)
@@ -31,7 +31,7 @@ test -f file && fail=1
 test -f "$other_partition_tmpdir/file" || fail=1
 
 # This would have failed with the mv from fileutils-4.0i.
-mode=`ls -l "$other_partition_tmpdir/file" | cut -b-10`
+mode=$(ls -l "$other_partition_tmpdir/file" | cut -b-10)
 test "$mode" = "-rwxrwxrwx" || fail=1
 
 Exit $fail
index 2a064b64f2173ed37e3c8e9447224256147de6b5..c203d7a4b8e22b6012f781991d1f47e6923cccd6 100755 (executable)
@@ -38,6 +38,6 @@ mv $file $rem_symlink || fail=1
 test -f $file && fail=1
 
 # Make sure $rem_file is unmodified.
-test `cat $rem_file` = remote || fail=1
+test $(cat $rem_file) = remote || fail=1
 
 Exit $fail
index d002a183b30ca26f2c4f4a7e1d61e0f4c6b01bad..f0beb40765d4fe8967fdfc3409613ebfc40eb60c 100755 (executable)
@@ -31,15 +31,15 @@ for interactive in '' -i; do
     # mistakenly elicit a prompt.
     $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
     test -s out && fail=1
-    case "`cat new`" in new) ;; *) fail=1 ;; esac
-    case "`cat old`" in old) ;; *) fail=1 ;; esac
+    case "$(cat new)" in new) ;; *) fail=1 ;; esac
+    case "$(cat old)" in old) ;; *) fail=1 ;; esac
   done
 done
 
 # This will actually perform the rename.
 mv --update new old || fail=1
 test -f new && fail=1
-case "`cat old`" in new) ;; *) fail=1 ;; esac
+case "$(cat old)" in new) ;; *) fail=1 ;; esac
 
 # Restore initial conditions.
 echo old > old || fail=1
@@ -48,7 +48,7 @@ echo new > new || fail=1
 
 # This will actually perform the copy.
 cp --update new old || fail=1
-case "`cat old`" in new) ;; *) fail=1 ;; esac
-case "`cat new`" in new) ;; *) fail=1 ;; esac
+case "$(cat old)" in new) ;; *) fail=1 ;; esac
+case "$(cat new)" in new) ;; *) fail=1 ;; esac
 
 Exit $fail
index d3d3a55cdcdee369ab4511e62067ce50a8cbee2a..4bdfe6ff5280e4b1e631008e4381d7445f190af4 100644 (file)
@@ -24,13 +24,13 @@ test "${CANDIDATE_TMP_DIRS+set}" = set \
 
 other_partition_tmpdir=
 
-dot_mount_point=`stat -c %d .`
+dot_mount_point=$(stat -c %d .)
 for d in $CANDIDATE_TMP_DIRS; do
 
   # Skip nonexistent directories.
   test -d "$d" || continue
 
-  d_mount_point=`stat -L -c %d "$d"`
+  d_mount_point=$(stat -L -c %d "$d")
 
   # Same partition?  Skip it.
   test "x$d_mount_point" = "x$dot_mount_point" && continue
index 5dc73892d22b17d6a7eebd68ef23c8fb594eb2fd..32b75c5952de1d2bd41cb0f23c843adb0bfc368d 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ readlink
 
-pwd=`pwd`
+pwd=$(pwd)
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
@@ -38,7 +38,7 @@ cd "$pwd/$tmp/removed" || framework_failure_
 
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
-  v=`readlink -e .` && fail=1
+  v=$(readlink -e .) && fail=1
   test -z "$v" || fail=1
 fi
 
@@ -46,58 +46,58 @@ cd "$pwd/$tmp" || fail=1
 
 for p in "" "$pwd/$tmp/"; do
 
-  v=`readlink -e "${p}regfile"` || fail=1
+  v=$(readlink -e "${p}regfile") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -e "${p}./regfile/"` && fail=1
+  v=$(readlink -e "${p}./regfile/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}subdir"` || fail=1
+  v=$(readlink -e "${p}subdir") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -e "${p}./subdir/"` || fail=1
+  v=$(readlink -e "${p}./subdir/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -e "${p}missing"` && fail=1
+  v=$(readlink -e "${p}missing") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}./missing/"` && fail=1
+  v=$(readlink -e "${p}./missing/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link1"` || fail=1
+  v=$(readlink -e "${p}link1") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -e "${p}./link1/"` && fail=1
+  v=$(readlink -e "${p}./link1/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link1/more"` && fail=1
+  v=$(readlink -e "${p}link1/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link2"` || fail=1
+  v=$(readlink -e "${p}link2") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -e "${p}./link2/"` || fail=1
+  v=$(readlink -e "${p}./link2/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -e "${p}link2/more"` && fail=1
+  v=$(readlink -e "${p}link2/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link3"` && fail=1
+  v=$(readlink -e "${p}link3") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}./link3/"` && fail=1
+  v=$(readlink -e "${p}./link3/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link3/more"` && fail=1
+  v=$(readlink -e "${p}link3/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link4"` && fail=1
+  v=$(readlink -e "${p}link4") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}./link4/"` && fail=1
+  v=$(readlink -e "${p}./link4/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -e "${p}link4/more"` && fail=1
+  v=$(readlink -e "${p}link4/more") && fail=1
   test -z "$v" || fail=1
 done
 
index aff8c80ed968f360df2cee8ed61947a434c5795a..3f296010ca3af592d8eb05e9031995c3cd5c371d 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ readlink
 
-pwd=`pwd`
+pwd=$(pwd)
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
@@ -39,7 +39,7 @@ cd "$pwd/$tmp/removed" || framework_failure_
 
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
-  v=`readlink -e .` && fail=1
+  v=$(readlink -e .) && fail=1
   test -z "$v" || fail=1
 fi
 
@@ -47,106 +47,106 @@ cd "$pwd/$tmp" || fail=1
 
 for p in "" "$pwd/$tmp/"; do
 
-  v=`readlink -f "${p}regfile"` || fail=1
+  v=$(readlink -f "${p}regfile") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -f "${p}./regfile/"` && fail=1
+  v=$(readlink -f "${p}./regfile/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}regfile/more"` && fail=1
+  v=$(readlink -f "${p}regfile/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./regfile/more/"` && fail=1
+  v=$(readlink -f "${p}./regfile/more/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}subdir"` || fail=1
+  v=$(readlink -f "${p}subdir") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -f "${p}./subdir/"` || fail=1
+  v=$(readlink -f "${p}./subdir/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -f "${p}subdir/more"` || fail=1
+  v=$(readlink -f "${p}subdir/more") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -f "${p}./subdir/more/"` || fail=1
+  v=$(readlink -f "${p}./subdir/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -f "${p}missing"` || fail=1
+  v=$(readlink -f "${p}missing") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -f "${p}./missing/"` || fail=1
+  v=$(readlink -f "${p}./missing/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -f "${p}missing/more"` && fail=1
+  v=$(readlink -f "${p}missing/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./missing/more/"` && fail=1
+  v=$(readlink -f "${p}./missing/more/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link1"` || fail=1
+  v=$(readlink -f "${p}link1") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -f "${p}./link1/"` && fail=1
+  v=$(readlink -f "${p}./link1/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link1/more"` && fail=1
+  v=$(readlink -f "${p}link1/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link1/more/"` && fail=1
+  v=$(readlink -f "${p}./link1/more/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link2"` || fail=1
+  v=$(readlink -f "${p}link2") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -f "${p}./link2/"` || fail=1
+  v=$(readlink -f "${p}./link2/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -f "${p}link2/more"` || fail=1
+  v=$(readlink -f "${p}link2/more") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -f "${p}./link2/more/"` || fail=1
+  v=$(readlink -f "${p}./link2/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -f "${p}link2/more/more2"` && fail=1
+  v=$(readlink -f "${p}link2/more/more2") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link2/more/more2/"` && fail=1
+  v=$(readlink -f "${p}./link2/more/more2/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link3"` || fail=1
+  v=$(readlink -f "${p}link3") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -f "${p}./link3/"` || fail=1
+  v=$(readlink -f "${p}./link3/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -f "${p}link3/more"` && fail=1
+  v=$(readlink -f "${p}link3/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link3/more/"` && fail=1
+  v=$(readlink -f "${p}./link3/more/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link4"` || fail=1
+  v=$(readlink -f "${p}link4") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
 
-  v=`readlink -f "${p}./link4/"` || fail=1
+  v=$(readlink -f "${p}./link4/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
 
-  v=`readlink -f "${p}link4/more"` && fail=1
+  v=$(readlink -f "${p}link4/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link4/more"` && fail=1
+  v=$(readlink -f "${p}./link4/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link5"` && fail=1
+  v=$(readlink -f "${p}link5") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link5/"` && fail=1
+  v=$(readlink -f "${p}./link5/") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}link5/more"` && fail=1
+  v=$(readlink -f "${p}link5/more") && fail=1
   test -z "$v" || fail=1
 
-  v=`readlink -f "${p}./link5/more"` && fail=1
+  v=$(readlink -f "${p}./link5/more") && fail=1
   test -z "$v" || fail=1
 done
 
index d3e0b7c3053bb0d74055eee391b2198be98e0945..09a96f5093ee40a5cd81cf05cc755fa1912b29b9 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ readlink
 
-pwd=`pwd`
+pwd=$(pwd)
 my_pwd=$("$abs_top_builddir/src/pwd")
 tmp=d
 
@@ -38,7 +38,7 @@ cd "$pwd/$tmp/removed" || framework_failure_
 
 # Skip this test if the system doesn't let you remove the working directory.
 if rmdir ../removed 2>/dev/null; then
-  v=`readlink -e .` && fail=1
+  v=$(readlink -e .) && fail=1
   test -z "$v" || fail=1
 fi
 
@@ -46,94 +46,94 @@ cd "$pwd/$tmp" || fail=1
 
 for p in "" "$pwd/$tmp/"; do
 
-  v=`readlink -m "${p}regfile"` || fail=1
+  v=$(readlink -m "${p}regfile") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -m "${p}./regfile/"` || fail=1
+  v=$(readlink -m "${p}./regfile/") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -m "${p}regfile/more"` || fail=1
+  v=$(readlink -m "${p}regfile/more") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile/more" || fail=1
 
-  v=`readlink -m "${p}./regfile/more/"` || fail=1
+  v=$(readlink -m "${p}./regfile/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile/more" || fail=1
 
-  v=`readlink -m "${p}subdir"` || fail=1
+  v=$(readlink -m "${p}subdir") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -m "${p}./subdir/"` || fail=1
+  v=$(readlink -m "${p}./subdir/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -m "${p}subdir/more"` || fail=1
+  v=$(readlink -m "${p}subdir/more") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -m "${p}./subdir/more/"` || fail=1
+  v=$(readlink -m "${p}./subdir/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -m "${p}missing"` || fail=1
+  v=$(readlink -m "${p}missing") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -m "${p}./missing/"` || fail=1
+  v=$(readlink -m "${p}./missing/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -m "${p}missing/more"` || fail=1
+  v=$(readlink -m "${p}missing/more") || fail=1
   test "$v" = "$my_pwd/$tmp/missing/more" || fail=1
 
-  v=`readlink -m "${p}./missing/more/"` || fail=1
+  v=$(readlink -m "${p}./missing/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing/more" || fail=1
 
-  v=`readlink -m "${p}link1"` || fail=1
+  v=$(readlink -m "${p}link1") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -m "${p}./link1/"` || fail=1
+  v=$(readlink -m "${p}./link1/") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile" || fail=1
 
-  v=`readlink -m "${p}link1/more"` || fail=1
+  v=$(readlink -m "${p}link1/more") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile/more" || fail=1
 
-  v=`readlink -m "${p}./link1/more/"` || fail=1
+  v=$(readlink -m "${p}./link1/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/regfile/more" || fail=1
 
-  v=`readlink -m "${p}link2"` || fail=1
+  v=$(readlink -m "${p}link2") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -m "${p}./link2/"` || fail=1
+  v=$(readlink -m "${p}./link2/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir" || fail=1
 
-  v=`readlink -m "${p}link2/more"` || fail=1
+  v=$(readlink -m "${p}link2/more") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -m "${p}./link2/more/"` || fail=1
+  v=$(readlink -m "${p}./link2/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more" || fail=1
 
-  v=`readlink -m "${p}link2/more/more2"` || fail=1
+  v=$(readlink -m "${p}link2/more/more2") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more/more2" || fail=1
 
-  v=`readlink -m "${p}./link2/more/more2/"` || fail=1
+  v=$(readlink -m "${p}./link2/more/more2/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/more/more2" || fail=1
 
-  v=`readlink -m "${p}link3"` || fail=1
+  v=$(readlink -m "${p}link3") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -m "${p}./link3/"` || fail=1
+  v=$(readlink -m "${p}./link3/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing" || fail=1
 
-  v=`readlink -m "${p}link3/more"` || fail=1
+  v=$(readlink -m "${p}link3/more") || fail=1
   test "$v" = "$my_pwd/$tmp/missing/more" || fail=1
 
-  v=`readlink -m "${p}./link3/more/"` || fail=1
+  v=$(readlink -m "${p}./link3/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/missing/more" || fail=1
 
-  v=`readlink -m "${p}link4"` || fail=1
+  v=$(readlink -m "${p}link4") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
 
-  v=`readlink -m "${p}./link4/"` || fail=1
+  v=$(readlink -m "${p}./link4/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing" || fail=1
 
-  v=`readlink -m "${p}link4/more"` || fail=1
+  v=$(readlink -m "${p}link4/more") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing/more" || fail=1
 
-  v=`readlink -m "${p}./link4/more/"` || fail=1
+  v=$(readlink -m "${p}./link4/more/") || fail=1
   test "$v" = "$my_pwd/$tmp/subdir/missing/more" || fail=1
 
 done
index 7f2ddc2e0b1a44e6bca1ce149d1f665ffaf75676..511a9890e91f1938796d92a464f923dd9a2c0a74 100755 (executable)
@@ -25,19 +25,19 @@ ln -s regfile link1 || framework_failure_
 ln -s missing link2 || framework_failure_
 
 
-v=`readlink link1` || fail=1
+v=$(readlink link1) || fail=1
 test "$v" = regfile || fail=1
 
-v=`readlink link2` || fail=1
+v=$(readlink link2) || fail=1
 test "$v" = missing || fail=1
 
-v=`readlink subdir` && fail=1
+v=$(readlink subdir) && fail=1
 test -z "$v" || fail=1
 
-v=`readlink regfile` && fail=1
+v=$(readlink regfile) && fail=1
 test -z "$v" || fail=1
 
-v=`readlink missing` && fail=1
+v=$(readlink missing) && fail=1
 test -z "$v" || fail=1
 
 Exit $fail
index dc443e1fd5489f2400c823c982d7c44528a6ebaa..344325e13f222fea38eb12b4fde8ad8fbb4f1def 100755 (executable)
@@ -24,7 +24,7 @@ expensive_
 
 # Create a hierarchy with 3*26 leaf directories, each at depth 153.
 echo "$0: creating 78 trees, each of depth 153; this will take a while..." >&2
-y=`seq 1 150|tr -sc '\n' y|tr '\n' /`
+y=$(seq 1 150|tr -sc '\n' y|tr '\n' /)
 for i in 1 2 3; do
   for j in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
     mkdir -p t/$i/$j/$y || framework_failure_
index e9e1788ea3147953aa737dd74c45a3d1ce00d261..2f045815e1e1b7bf75aec1dcea70b82ea5a471fd 100755 (executable)
@@ -25,7 +25,7 @@ print_ver_ rm
 require_openat_support_
 skip_if_root_
 
-p=`pwd`
+p=$(pwd)
 mkdir abs1 abs2 no-access || framework_failure_
 
 
index ac295902021ecf8ef22ba674887b7c496b2805e1..01b33bc1e7a7fe4b80cec75161cdd0d01a3da562 100755 (executable)
@@ -48,7 +48,7 @@ rm --verbose -i -r $t < in > /dev/null 2>&1 || fail=1
 test -d $t || fail=1
 
 # There should be only one directory left.
-case `echo $t/*` in
+case $(echo $t/*) in
   $t/[abc]) ;;
   *) fail=1 ;;
 esac
index e530dcee327cf4ae4c7c901cb21e2f6b04ca24f5..018648be0f4af97ba16d928688ea605374b3e9d1 100755 (executable)
@@ -20,7 +20,7 @@
 print_ver_ rm
 require_root_
 
-cwd=`pwd`
+cwd=$(pwd)
 cleanup_() { cd /; umount "$cwd/mnt"; }
 
 skip=0
index 939ce9862fe4b2d1760437cbc239f8d01dc88f57..711e1bc0e2e6ecd90d1136f739e5ed728548df4c 100755 (executable)
@@ -26,8 +26,8 @@ print_ver_ rm
 # http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
 mkdir b || framework_failure_
 cd b || framework_failure_
-for i in `seq 1 250`; do
-  touch `printf %040d $i` || framework_failure_
+for i in $(seq 1 250); do
+  touch $(printf %040d $i) || framework_failure_
 done
 cd .. || framework_failure_
 
index 336c05a1bbd3d7bf5fb4ee4212cc6375c27e5466..4b8bbc2d322f9ac512df4cb3b45303aa96e9860f 100755 (executable)
@@ -23,7 +23,7 @@ skip_if_root_
 mkdir -p a/1 b c d/2 e/3 || framework_failure_
 
 
-t=`pwd`
+t=$(pwd)
 cd c
 chmod u=x,go= .
 
index dd02819d2068d8454b37e4a6d4b3027417abe8d9..92463b8d8abcb2115c04e2ca538fda0ab5fc339d 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ rmdir
 
-cwd=`pwd`
+cwd=$(pwd)
 mkdir -p "$cwd/a/b/c" "$cwd/a/x" || framework_failure_
 
 rmdir -p --ignore-fail-on-non-empty "$cwd/a/b/c" || fail=1
index 37b9afbcf5c39b3af77013690b6fe022d3953727..043e25937d3e43bea9dda83a1e9012efdd7648b6 100755 (executable)
@@ -51,7 +51,7 @@ mv f foo
 # echo waiting....
 wait
 
-case "`cat err`" in
+case "$(cat err)" in
   *$ok) ;;
   *) fail=1;;
 esac
index e6c95f824af8a0d871bcfaf38ddc84a72623f307..d94d3d8e248e59306225617bcc25cd92b0af38c3 100755 (executable)
@@ -39,7 +39,7 @@ mv f foo
 # echo waiting....
 wait
 
-case "`cat err`" in
+case "$(cat err)" in
   *$ok) ;;
   *) fail=1;;
 esac
index 576a302bb6362c34326b057f5b436c16c5ffe008..1eb2ed38afe5b94ec9fb525a7481f92758a34715 100755 (executable)
@@ -32,7 +32,7 @@ rm -f touch-target t-symlink
 if test $fail = 1; then
   case $host_triplet in
     *linux-gnu*)
-      case "`uname -r`" in
+      case "$(uname -r)" in
         2.3.9[0-9]*)
           skip_ \
 '****************************************************
index cd679c41e1ea1f0d9207e0b004f5f5893848cca4..a150bd58ee3458783d34abc40c5b1660611845c6 100755 (executable)
@@ -48,7 +48,7 @@ echo sleeping for $SLEEP_SECONDS seconds...
 sleep $SLEEP_SECONDS
 for d in $TOUCH_DIR_LIST; do
   touch $d/a || fail=1
-  set x `ls -t $d/a $d/b`
+  set x $(ls -t $d/a $d/b)
   test "$*" = "x $d/a $d/b" || fail=1
 done
 
@@ -56,11 +56,11 @@ echo sleeping for $SLEEP_SECONDS seconds...
 sleep $SLEEP_SECONDS
 for d in $TOUCH_DIR_LIST; do
   touch $d/b
-  set x `ls -t $d/a $d/b`
+  set x $(ls -t $d/a $d/b)
   test "$*" = "x $d/b $d/a" || fail=1
 
   if touch - 1< $d/c 2> /dev/null; then
-    set x `ls -t $d/a $d/c`
+    set x $(ls -t $d/a $d/c)
     test "$*" = "x $d/c $d/a" || fail=1
   fi
 
index 6f031424ef8568e4e35fd1577654c9966bd6635f..aee9a5cfcf38314f14af91fffd1f721468ddaff5 100755 (executable)
@@ -58,11 +58,11 @@ esac
 
 # Change the mtime of a symlink.
 touch -m -h -d 2009-10-10 link || fail=1
-case `stat --format=%y link` in
+case $(stat --format=%y link) in
   2009-10-10*) ;;
   *) fail=1 ;;
 esac
-case `stat --format=%y file` in
+case $(stat --format=%y file) in
   2009-10-10*) fail=1;;
 esac
 
index 25364e287152b0a1413adcc4a8c5b27cc2a31e4e..abebc52610d47c059abfed059c8d9d1564411395 100755 (executable)
@@ -24,14 +24,14 @@ print_ver_ touch
 touch -d '2000-01-01 00:00' t1 || framework_failure_
 touch -d '2000-01-02 00:00' t2 || framework_failure_
 
-set x `ls -t t1 t2`
+set x $(ls -t t1 t2)
 test "$*" = "x t2 t1" || framework_failure_
 
 
 chmod 0 t1
 touch -d '2000-01-03 00:00' -c t1 || fail=1
 
-set x `ls -t t1 t2`
+set x $(ls -t t1 t2)
 test "$*" = "x t1 t2" || fail=1
 
 # Also test the combination of --no-create and -a.
index f9c32fd7dadea0fec3c89e0be04989c32857ef6f..f09695c0784dfae47087d31ceb9fc6ce3ffa8d9b 100755 (executable)
@@ -51,14 +51,14 @@ test -f nowhere && fail=1
 # symlinks and directories under Cygwin 1.5).
 touch -d 2009-10-10 -h link2/ || fail=1
 touch -h -r link2/ file || fail=1
-case `stat --format=%y dir` in
+case $(stat --format=%y dir) in
   2009-10-10*) ;;
   *) fail=1 ;;
 esac
-case `stat --format=%y link2` in
+case $(stat --format=%y link2) in
   2009-10-10*) fail=1 ;;
 esac
-case `stat --format=%y file` in
+case $(stat --format=%y file) in
   2009-10-10*) ;;
   *) fail=1 ;;
 esac