coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] tests: remove nearly all remaining backticks


From: Jim Meyering
Subject: [PATCH 4/4] tests: remove nearly all remaining backticks
Date: Tue, 3 Apr 2012 22:25:36 +0200

From: Jim Meyering <address@hidden>

* tests/rm/isatty: Remove now-unneeded "# `" line.
* tests/misc/ls-time: Likewise.
* tests/misc/date-sec: Remove stray "`" in comment.
* tests/du/long-sloop: Likewise.
* tests/mv/part-symlink: Replace multi-line `...` by $(...).
* tests/mv/sticky-to-xpart: Likewise.
* tests/rm/fail-2eperm: Likewise.
* tests/ls/nameless-uid: Likewise.
* tests/cp/perm: Likewise.
* tests/cp/preserve-gid: Likewise.
* tests/cp/same-file: Likewise.
---
 tests/cp/perm            |    8 ++++----
 tests/cp/preserve-gid    |   12 ++++++------
 tests/cp/same-file       |    6 +++---
 tests/du/long-sloop      |    4 ++--
 tests/ls/nameless-uid    |    4 ++--
 tests/misc/date-sec      |    2 +-
 tests/misc/ls-time       |    1 -
 tests/mv/part-symlink    |   12 ++++++------
 tests/mv/sticky-to-xpart |    4 ++--
 tests/rm/fail-2eperm     |    4 ++--
 tests/rm/isatty          |    1 -
 11 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/tests/cp/perm b/tests/cp/perm
index eb3925d..a93df71 100755
--- a/tests/cp/perm
+++ b/tests/cp/perm
@@ -55,13 +55,13 @@ for u in 31 37 2; do
                 ;;
               cp:*:no)
                 test $u = 37 &&
-                  expected_perms=`
+                  expected_perms=$(
                     echo $expected_perms | sed 's/.....$/-----/'
-                  `
+                  )
                 test $u = 31 &&
-                  expected_perms=`
+                  expected_perms=$(
                     echo $expected_perms | sed 's/..\(..\).$/--\1-/'
-                  `
+                  )
                 ;;
             esac
             test _$actual_perms = _$expected_perms || exit 1
diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid
index 6f371c3..746c57a 100755
--- a/tests/cp/preserve-gid
+++ b/tests/cp/preserve-gid
@@ -52,24 +52,24 @@ t0() {
   fi
 }

-nameless_uid=`$PERL -le '
+nameless_uid=$($PERL -le '
   foreach my $i (1000..16*1024-1)
     {
       getpwuid $i or (print $i), exit
     }
-'`
-nameless_gid1=`$PERL -le '
+')
+nameless_gid1=$($PERL -le '
   foreach my $i (1000..16*1024)
     {
       getgrgid $i or (print $i), exit
     }
-'`
-nameless_gid2=`$PERL -le '
+')
+nameless_gid2=$($PERL -le '
   foreach my $i ('"$nameless_gid1"'+1..16*1024)
     {
       getgrgid $i or (print $i), exit
     }
-'`
+')

 if test -z "$nameless_uid" \
     || test -z "$nameless_gid1" \
diff --git a/tests/cp/same-file b/tests/cp/same-file
index dbd4d01..2ca7bf6 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -102,10 +102,10 @@ for args in 'foo symlink' 'symlink foo' 'foo foo' 'sl1 
sl2' 'foo hardlink'; do
           ' _err
         fi
         # Strip off all but the file names.
-        ls=`ls -gG --ignore=_err . \
-            | sed \
+        ls=$(ls -gG --ignore=_err . \
+             | sed \
                 -e '/^total /d' \
-                -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//'`
+                -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//')
         echo "($ls)"
         # Make sure the original is unchanged and that
         # the destination is a copy.
diff --git a/tests/du/long-sloop b/tests/du/long-sloop
index f9e70ad..48e2e30 100755
--- a/tests/du/long-sloop
+++ b/tests/du/long-sloop
@@ -50,8 +50,8 @@ echo foo > $i
 # The following also serves to record in 'err' the string
 # corresponding to strerror (ELOOP).  This is necessary because while
 # Linux/libc gives 'Too many levels of symbolic links', Solaris
-# renders it as `Number of symbolic links encountered during path
-# name traversal exceeds MAXSYMLINKS'.
+# renders it as "Number of symbolic links encountered during path
+# name traversal exceeds MAXSYMLINKS".

 cat $file > /dev/null 2> err &&
     skip_ 'Your system appears to be able to handle more than $n symlinks
diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid
index 1c8c471..5b45b09 100755
--- a/tests/ls/nameless-uid
+++ b/tests/ls/nameless-uid
@@ -22,9 +22,9 @@ print_ver_ ls
 require_root_
 require_perl_

-nameless_uid=`$PERL -e '
+nameless_uid=$($PERL -e '
   foreach my $i (1000..16*1024) { getpwuid $i or (print "$i\n"), exit }
-'`
+')

 if test x$nameless_uid = x; then
   skip_ "couldn't find a nameless UID"
diff --git a/tests/misc/date-sec b/tests/misc/date-sec
index df77fe7..a46b479 100755
--- a/tests/misc/date-sec
+++ b/tests/misc/date-sec
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Ensure that a command like
-# `date --date="21:04 +0100" +%S' always prints '00'.
+# date --date="21:04 +0100" +%S' always prints '00'.
 # Before coreutils-5.2.1, it would print the seconds from the current time.

 # Copyright (C) 2004-2012 Free Software Foundation, Inc.
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index 7bc3c64..7d1f205 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -70,7 +70,6 @@ tests in this file will not be run.
 In the output below, the date of last modification for 'a' should
 have been $t3.
 EOF
-  #`
   ls --full -l a
   framework_failure_
   ;;
diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink
index 2e7cf1b..e57de3c 100755
--- a/tests/mv/part-symlink
+++ b/tests/mv/part-symlink
@@ -96,18 +96,18 @@ for copy in cp mv; do
             }
           # Strip off all but the file names.
           # Remove any site-dependent part of each file name.
-          ls=`ls -gG --ignore=.err . \
-              | sed \
+          ls=$(ls -gG --ignore=.err . \
+               | sed \
                   -e '/^total /d' \
                   -e "s,$other_partition_tmpdir/,," \
                   -e "s,$pwd_tmp/,," \
-                  -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//'`
-          ls2=`cd "$other_partition_tmpdir" && ls -gG --ignore=.err . \
-              | sed \
+                  -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//')
+          ls2=$(cd "$other_partition_tmpdir" && ls -gG --ignore=.err . \
+                | sed \
                   -e '/^total /d' \
                   -e "s,$other_partition_tmpdir/,," \
                   -e "s,$pwd_tmp/,," \
-                  -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//'`
+                  -e 's/^[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *[^ ]*  *//')
           echo " ("$ls") ("$ls2")"

           # If the command failed, then it must not have changed the files.
diff --git a/tests/mv/sticky-to-xpart b/tests/mv/sticky-to-xpart
index 954cb8f..6df6502 100755
--- a/tests/mv/sticky-to-xpart
+++ b/tests/mv/sticky-to-xpart
@@ -41,10 +41,10 @@ chmod go+x . || framework_failure_


 # Ensure that $NON_ROOT_USERNAME can access the required version of mv.
-version=`
+version=$(
   setuidgid $NON_ROOT_USERNAME env PATH="$PATH" mv --version |
   sed -n '1s/.* //p'
-`
+)
 case $version in
   $PACKAGE_VERSION) ;;
   *) skip_ "cannot access just-built mv as user $NON_ROOT_USERNAME";;
diff --git a/tests/rm/fail-2eperm b/tests/rm/fail-2eperm
index 9162892..fa2f432 100755
--- a/tests/rm/fail-2eperm
+++ b/tests/rm/fail-2eperm
@@ -31,10 +31,10 @@ touch a/b || framework_failure_

 # Try to ensure that $NON_ROOT_USERNAME can access
 # the required version of rm.
-rm_version=`
+rm_version=$(
   setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version |
   sed -n '1s/.* //p'
-`
+)
 case $rm_version in
   $PACKAGE_VERSION) ;;
   *) skip_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
diff --git a/tests/rm/isatty b/tests/rm/isatty
index b1e558b..f28653c 100755
--- a/tests/rm/isatty
+++ b/tests/rm/isatty
@@ -44,7 +44,6 @@ kill $pid > /dev/null 2>&1
 cat > exp <<\EOF
 rm: remove write-protected regular empty file 'f'? x
 EOF
-#`

 # Append an 'x' and a newline.
 echo x >> out
-- 
1.7.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]