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.
# 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 ;;
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
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" \
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
# 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
# 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
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
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
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
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
# 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_
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 ;;
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
'')
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.
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
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
# 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 '/'
. "${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
# 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
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
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.
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
require_root_
-cwd=`pwd`
+cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/noxattr"; umount "$cwd/xattr"; }
skip=0
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
# 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
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 ||
echo foo
) >fifo
-case `cat ls.out` in
+case $(cat ls.out) in
-???------*) ;;
*) fail=1;;
esac
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
# --------------------------------------
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
# --------------------------------------
# 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
# --------------------------------------
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
# --------------------------------------
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
# --------------------------------------
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
# 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
# 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
# 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
# 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
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????-??-?* | \
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)
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).
# 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
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;;
# 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
# 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
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
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
# 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
# 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
# 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
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
=================================================================
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.
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
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
# 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";;
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.
# 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
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
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
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
# 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
skip_if_root_
-cwd=`pwd`
+cwd=$(pwd)
mkdir -p no-x a/b || framework_failure_
cd no-x || framework_failure_
chmod 0 . || framework_failure_
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
# cannot access parent directories:
# (all on one line).
-cwd=`pwd`
+cwd=$(pwd)
# Use perl instead:
: ${PERL=perl}
$PERL \
# 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) ;;
*)
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.
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"
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"
}
# 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"
{
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
# 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
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
# 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_()
{
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.
# 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 . &&
# 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" .
# ===================================================
# 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 ;;
# ===================================================
# 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 ;;
# 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
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
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
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
# 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
# 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
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
# 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
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
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
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
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.
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
# 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;;
# 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;;
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ df
-case `df .` in
+case $(df .) in
*'
'*) ;;
*) fail=1;;
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:
# 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
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
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; }
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
# 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
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") ;;
*)
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") ;;
*)
;;
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
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
set $tests
# Require that this test be run at 'nice' level 0.
-niceness=`nice`
+niceness=$(nice)
if test "$niceness" = 0; then
: ok
else
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
# 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
# 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
# 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
# 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
# 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
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.
# 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
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
# 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
-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
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
# 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
# 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
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
done
fi
-stty `cat $saved_state`
+stty $(cat $saved_state)
Exit $fail
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
# 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.
'
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
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
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
# 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
. "${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
. "${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
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
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
# 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
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=
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 ;;
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 ;;
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
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
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
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
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
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
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.
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
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
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
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
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
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
test -f h && fail=1
# Make sure there was no prompt.
-case "`cat out`" in
+case "$(cat out)" in
'') ;;
*) fail=1 ;;
esac
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
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
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_
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
# 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.
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)
(
(
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
if test $copy_status != 0; then
test
fi
- case "`cat $f`" in
+ case "$(cat $f)" in
"$contents") ;;
*) echo " $copy FAILED";;
esac
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
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
# 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
# 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
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
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ readlink
-pwd=`pwd`
+pwd=$(pwd)
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
# 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
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
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ readlink
-pwd=`pwd`
+pwd=$(pwd)
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
# 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
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
. "${srcdir=.}/init.sh"; path_prepend_ ../src
print_ver_ readlink
-pwd=`pwd`
+pwd=$(pwd)
my_pwd=$("$abs_top_builddir/src/pwd")
tmp=d
# 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
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
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
# 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_
require_openat_support_
skip_if_root_
-p=`pwd`
+p=$(pwd)
mkdir abs1 abs2 no-access || framework_failure_
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
print_ver_ rm
require_root_
-cwd=`pwd`
+cwd=$(pwd)
cleanup_() { cd /; umount "$cwd/mnt"; }
skip=0
# 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_
mkdir -p a/1 b c d/2 e/3 || framework_failure_
-t=`pwd`
+t=$(pwd)
cd c
chmod u=x,go= .
. "${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
# echo waiting....
wait
-case "`cat err`" in
+case "$(cat err)" in
*$ok) ;;
*) fail=1;;
esac
# echo waiting....
wait
-case "`cat err`" in
+case "$(cat err)" in
*$ok) ;;
*) fail=1;;
esac
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_ \
'****************************************************
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
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
# 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
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.
# 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