tests: convert nearly all ... expressions to $(...)

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
This commit is contained in:
Jim Meyering 2012-04-03 20:32:44 +02:00
parent 64ecea53d9
commit e43d30eab3
124 changed files with 429 additions and 429 deletions

View File

@ -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 $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 -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 ;;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 ;;

View File

@ -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
'')

View File

@ -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

View File

@ -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

View File

@ -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 '/'

View File

@ -19,16 +19,16 @@
. "${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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -23,7 +23,7 @@ print_ver_ cp mv
require_root_
cwd=`pwd`
cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/noxattr"; umount "$cwd/xattr"; }
skip=0

View File

@ -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

View File

@ -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

View File

@ -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 ||

View File

@ -46,7 +46,7 @@ cp_pid=$!
echo foo
) >fifo
case `cat ls.out` in
case $(cat ls.out) in
-???------*) ;;
*) fail=1;;
esac

View File

@ -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
# --------------------------------------

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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????-??-?* | \

View File

@ -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)

View File

@ -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).

View File

@ -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

View File

@ -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;;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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 \

View File

@ -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.

View File

@ -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"

View 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_()
{

View File

@ -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 . &&

View File

@ -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" .

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -20,20 +20,20 @@
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

View File

@ -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

View File

@ -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

View File

@ -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;;

View File

@ -19,7 +19,7 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ df
case `df .` in
case $(df .) in
*'
'*) ;;
*) fail=1;;

View File

@ -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; }

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -20,10 +20,10 @@
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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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=

View File

@ -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 ;;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_

Some files were not shown because too many files have changed in this diff Show More