diff options
Diffstat (limited to 'tests/mv')
-rwxr-xr-x | tests/mv/acl | 12 | ||||
-rwxr-xr-x | tests/mv/atomic | 2 | ||||
-rwxr-xr-x | tests/mv/atomic2 | 2 | ||||
-rwxr-xr-x | tests/mv/childproof | 8 | ||||
-rwxr-xr-x | tests/mv/force | 2 | ||||
-rwxr-xr-x | tests/mv/hard-2 | 12 | ||||
-rwxr-xr-x | tests/mv/hard-3 | 6 | ||||
-rwxr-xr-x | tests/mv/hard-link-1 | 4 | ||||
-rwxr-xr-x | tests/mv/i-2 | 2 | ||||
-rwxr-xr-x | tests/mv/i-3 | 4 | ||||
-rwxr-xr-x | tests/mv/i-4 | 2 | ||||
-rwxr-xr-x | tests/mv/i-link-no | 2 | ||||
-rwxr-xr-x | tests/mv/leak-fd | 6 | ||||
-rwxr-xr-x | tests/mv/part-hardlink | 4 | ||||
-rwxr-xr-x | tests/mv/part-symlink | 12 | ||||
-rwxr-xr-x | tests/mv/partition-perm | 2 | ||||
-rwxr-xr-x | tests/mv/to-symlink | 2 | ||||
-rwxr-xr-x | tests/mv/update | 10 |
18 files changed, 47 insertions, 47 deletions
diff --git a/tests/mv/acl b/tests/mv/acl index 382752a33..2354ed967 100755 --- a/tests/mv/acl +++ b/tests/mv/acl @@ -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 diff --git a/tests/mv/atomic b/tests/mv/atomic index c2b38c690..e5391c337 100755 --- a/tests/mv/atomic +++ b/tests/mv/atomic @@ -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 diff --git a/tests/mv/atomic2 b/tests/mv/atomic2 index e329dba91..d9c55e2c9 100755 --- a/tests/mv/atomic2 +++ b/tests/mv/atomic2 @@ -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 diff --git a/tests/mv/childproof b/tests/mv/childproof index 04774d294..efe7225d6 100755 --- a/tests/mv/childproof +++ b/tests/mv/childproof @@ -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 diff --git a/tests/mv/force b/tests/mv/force index 79ff9e95a..6bed83bf9 100755 --- a/tests/mv/force +++ b/tests/mv/force @@ -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. diff --git a/tests/mv/hard-2 b/tests/mv/hard-2 index c1d25af0a..e0fc174f0 100755 --- a/tests/mv/hard-2 +++ b/tests/mv/hard-2 @@ -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 diff --git a/tests/mv/hard-3 b/tests/mv/hard-3 index 9dd8ad592..a62167a07 100755 --- a/tests/mv/hard-3 +++ b/tests/mv/hard-3 @@ -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 diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1 index eccd8bcdb..78a555ac9 100755 --- a/tests/mv/hard-link-1 +++ b/tests/mv/hard-link-1 @@ -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 diff --git a/tests/mv/i-2 b/tests/mv/i-2 index 84ccfe58b..f24801958 100755 --- a/tests/mv/i-2 +++ b/tests/mv/i-2 @@ -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 diff --git a/tests/mv/i-3 b/tests/mv/i-3 index 262b5ba04..3912842a2 100755 --- a/tests/mv/i-3 +++ b/tests/mv/i-3 @@ -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 diff --git a/tests/mv/i-4 b/tests/mv/i-4 index bcf3fdda2..8ef6ca77b 100755 --- a/tests/mv/i-4 +++ b/tests/mv/i-4 @@ -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 diff --git a/tests/mv/i-link-no b/tests/mv/i-link-no index a37a1ffba..4615eaabb 100755 --- a/tests/mv/i-link-no +++ b/tests/mv/i-link-no @@ -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 diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd index 532bdb082..d349a3f11 100755 --- a/tests/mv/leak-fd +++ b/tests/mv/leak-fd @@ -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_ diff --git a/tests/mv/part-hardlink b/tests/mv/part-hardlink index ac71bdf72..af773a23b 100755 --- a/tests/mv/part-hardlink +++ b/tests/mv/part-hardlink @@ -35,9 +35,9 @@ mv f g "$other_partition_tmpdir" || fail=1 mv a b "$other_partition_tmpdir" || fail=1 cd "$other_partition_tmpdir" -set `ls -Ci f g` +set $(ls -Ci f g) test $1 = $3 || fail=1 -set `ls -Ci a/1 b/1` +set $(ls -Ci a/1 b/1) test $1 = $3 || fail=1 Exit $fail diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink index 30cb4400e..2e7cf1b8b 100755 --- a/tests/mv/part-symlink +++ b/tests/mv/part-symlink @@ -27,7 +27,7 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; } # mv: preserving permissions for 'rem_sl': Operation not supported require_local_dir_ -pwd_tmp=`pwd` +pwd_tmp=$(pwd) # Unset CDPATH. Otherwise, output from the 'cd dir' command # can make this test fail. @@ -68,15 +68,15 @@ for copy in cp mv; do rm -f "$other_partition_tmpdir"/* || fail=1 mkdir dir || fail=1 cd dir || fail=1 - case "$args" in *loc_reg*) reg_abs="`pwd`/$loc_reg" ;; esac + case "$args" in *loc_reg*) reg_abs="$(pwd)/$loc_reg" ;; esac case "$args" in *rem_reg*) reg_abs=$rem_reg ;; esac case "$args" in *loc_sl*) slink=$loc_sl ;; esac case "$args" in *rem_sl*) slink=$rem_sl ;; esac echo $contents > "$reg_abs" || fail=1 ln -nsf "$reg_abs" $slink || fail=1 - actual_args=`echo $args|sed 's,^,$,;s/ / $/'` - actual_args=`eval echo $actual_args` + actual_args=$(echo $args|sed 's,^,$,;s/ / $/') + actual_args=$(eval echo $actual_args) ( ( @@ -115,7 +115,7 @@ for copy in cp mv; do for f in $actual_args; do test -f $f || { echo " $copy FAILED but removed $f"; continue; } - case "`cat $f`" in + case "$(cat $f)" in "$contents") ;; *) echo " $copy FAILED but modified $f";; esac @@ -130,7 +130,7 @@ for copy in cp mv; do if test $copy_status != 0; then test fi - case "`cat $f`" in + case "$(cat $f)" in "$contents") ;; *) echo " $copy FAILED";; esac diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm index 65ae5d024..bbda9da7a 100755 --- a/tests/mv/partition-perm +++ b/tests/mv/partition-perm @@ -31,7 +31,7 @@ test -f file && fail=1 test -f "$other_partition_tmpdir/file" || fail=1 # This would have failed with the mv from fileutils-4.0i. -mode=`ls -l "$other_partition_tmpdir/file" | cut -b-10` +mode=$(ls -l "$other_partition_tmpdir/file" | cut -b-10) test "$mode" = "-rwxrwxrwx" || fail=1 Exit $fail diff --git a/tests/mv/to-symlink b/tests/mv/to-symlink index 2a064b64f..c203d7a4b 100755 --- a/tests/mv/to-symlink +++ b/tests/mv/to-symlink @@ -38,6 +38,6 @@ mv $file $rem_symlink || fail=1 test -f $file && fail=1 # Make sure $rem_file is unmodified. -test `cat $rem_file` = remote || fail=1 +test $(cat $rem_file) = remote || fail=1 Exit $fail diff --git a/tests/mv/update b/tests/mv/update index d002a183b..f0beb4076 100755 --- a/tests/mv/update +++ b/tests/mv/update @@ -31,15 +31,15 @@ for interactive in '' -i; do # mistakenly elicit a prompt. $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1 test -s out && fail=1 - case "`cat new`" in new) ;; *) fail=1 ;; esac - case "`cat old`" in old) ;; *) fail=1 ;; esac + case "$(cat new)" in new) ;; *) fail=1 ;; esac + case "$(cat old)" in old) ;; *) fail=1 ;; esac done done # This will actually perform the rename. mv --update new old || fail=1 test -f new && fail=1 -case "`cat old`" in new) ;; *) fail=1 ;; esac +case "$(cat old)" in new) ;; *) fail=1 ;; esac # Restore initial conditions. echo old > old || fail=1 @@ -48,7 +48,7 @@ echo new > new || fail=1 # This will actually perform the copy. cp --update new old || fail=1 -case "`cat old`" in new) ;; *) fail=1 ;; esac -case "`cat new`" in new) ;; *) fail=1 ;; esac +case "$(cat old)" in new) ;; *) fail=1 ;; esac +case "$(cat new)" in new) ;; *) fail=1 ;; esac Exit $fail |