summaryrefslogtreecommitdiff
path: root/tests/mv
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-22 19:37:31 +0200
committerJim Meyering <jim@meyering.net>2006-10-22 19:37:31 +0200
commit2457af43cf6d670ab120c19bf4f23ac545ff24b5 (patch)
tree72e286663db916c5c42078075667d1ed1ade831d /tests/mv
parentf5417daca01691c0e6b409e39a534eb5e0f865d7 (diff)
downloadcoreutils-2457af43cf6d670ab120c19bf4f23ac545ff24b5.tar.xz
* tests/sample-test: Quote variables containing absolute build
tree paths. In the cleanup trap, make sure `cd' succeeds before `chmod'ing and `rm'ing the temporary files. * tests/chgrp/basic: Likewise. * tests/chgrp/deref: Likewise. * tests/chgrp/no-x: Likewise. * tests/chgrp/posix-H: Likewise. * tests/chgrp/recurse: Likewise. * tests/chmod/c-option: Likewise. * tests/chmod/equal-x: Likewise. * tests/chmod/equals: Likewise. * tests/chmod/inaccessible: Likewise. * tests/chmod/no-x: Likewise. * tests/chmod/octal: Likewise. * tests/chmod/setgid: Likewise. * tests/chmod/umask-x: Likewise. * tests/chmod/usage: Likewise. * tests/chown/basic: Likewise. * tests/chown/deref: Likewise. * tests/chown/separator: Likewise. * tests/cp/acl: Likewise. * tests/cp/backup-1: Likewise. * tests/cp/backup-dir: Likewise. * tests/cp/backup-is-src: Likewise. * tests/cp/cp-HL: Likewise. * tests/cp/cp-deref: Likewise. * tests/cp/cp-i: Likewise. * tests/cp/cp-mv-backup: Likewise. * tests/cp/cp-parents: Likewise. * tests/cp/deref-slink: Likewise. * tests/cp/dir-rm-dest: Likewise. * tests/cp/dir-slash: Likewise. * tests/cp/dir-vs-file: Likewise. * tests/cp/fail-perm: Likewise. * tests/cp/into-self: Likewise. * tests/cp/link: Likewise. * tests/cp/link-no-deref: Likewise. * tests/cp/link-preserve: Likewise. * tests/cp/no-deref-link1: Likewise. * tests/cp/no-deref-link2: Likewise. * tests/cp/no-deref-link3: Likewise. * tests/cp/perm: Likewise. * tests/cp/preserve-2: Likewise. * tests/cp/r-vs-symlink: Likewise. * tests/cp/same-file: Likewise. * tests/cp/slink-2-slink: Likewise. * tests/cp/sparse: Likewise. * tests/cp/special-bits: Likewise. * tests/cp/src-base-dot: Likewise. * tests/cp/symlink-slash: Likewise. * tests/dd/not-rewound: Likewise. * tests/dd/skip-seek2: Likewise. * tests/dd/unblock-sync: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/basic: Likewise. * tests/du/deref: Likewise. * tests/du/deref-args: Likewise. * tests/du/exclude: Likewise. * tests/du/fd-leak: Likewise. * tests/du/hard-link: Likewise. * tests/du/inaccessible-cwd: Likewise. * tests/du/long-from-unreadable: Likewise. * tests/du/long-sloop: Likewise. * tests/du/no-deref: Likewise. * tests/du/no-x: Likewise. * tests/du/restore-wd: Likewise. * tests/du/slash: Likewise. * tests/du/slink: Likewise. * tests/du/trailing-slash: Likewise. * tests/du/two-args: Likewise. * tests/fmt/long-line: Likewise. * tests/install/basic-1: Likewise. * tests/install/create-leading: Likewise. * tests/install/d-slashdot: Likewise. * tests/install/trap: Likewise. * tests/ln/misc: Likewise. * tests/ln/target-1: Likewise. * tests/ls/color-dtype-dir: Likewise. * tests/ls/dangle: Likewise. * tests/ls/dired: Likewise. * tests/ls/file-type: Likewise. * tests/ls/follow-slink: Likewise. * tests/ls/infloop: Likewise. * tests/ls/inode: Likewise. * tests/ls/m-option: Likewise. * tests/ls/no-arg: Likewise. * tests/ls/recursive: Likewise. * tests/ls/rt-1: Likewise. * tests/ls/stat-dtype: Likewise. * tests/ls/stat-failed: Likewise. * tests/ls/stat-vs-dirent: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/close-stdout: Likewise. * tests/misc/csplit: Likewise. * tests/misc/date-sec: Likewise. * tests/misc/false-status: Likewise. * tests/misc/head-c: Likewise. * tests/misc/head-pos: Likewise. * tests/misc/mknod: Likewise. * tests/misc/nl: Likewise. * tests/misc/nohup: Likewise. * tests/misc/pathchk1: Likewise. * tests/misc/printf: Likewise. * tests/misc/printf-hex: Likewise. * tests/misc/pwd-long: Likewise. * tests/misc/shuf: Likewise. * tests/misc/sort-rand: Likewise. * tests/misc/split-a: Likewise. * tests/misc/split-fail: Likewise. * tests/misc/split-l: Likewise. * tests/misc/stat-fmt: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/wc-files0: Likewise. * tests/mkdir/concurrent-1: Likewise. * tests/mkdir/p-1: Likewise. * tests/mkdir/p-2: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/p-slashdot: Likewise. * tests/mkdir/p-thru-slink: Likewise. * tests/mkdir/p-v: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. * tests/mkdir/t-slash: Likewise. * tests/mv/acl: Likewise. * tests/mv/atomic: Likewise. * tests/mv/backup-dir: Likewise. * tests/mv/childproof: Likewise. * tests/mv/diag: Likewise. * tests/mv/dir-file: Likewise. * tests/mv/dir2dir: Likewise. * tests/mv/dup-source: Likewise. * tests/mv/hard-2: Likewise. * tests/mv/hard-3: Likewise. * tests/mv/hard-4: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/hard-verbose: Likewise. * tests/mv/i-2: Likewise. * tests/mv/i-3: Likewise. * tests/mv/i-4: Likewise. * tests/mv/i-5: Likewise. * tests/mv/i-link-no: Likewise. * tests/mv/into-self-4: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/no-target-dir: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/perm-1: Likewise. * tests/mv/reply-no: Likewise. * tests/mv/trailing-slash: Likewise. * tests/mv/update: Likewise. * tests/od/od-N: Likewise. * tests/od/x8: Likewise. * tests/readlink/can-e: Likewise. * tests/readlink/can-f: Likewise. * tests/readlink/can-m: Likewise. * tests/readlink/rl-1: Likewise. * tests/rm/cycle: Likewise. * tests/rm/dangling-symlink: Likewise. * tests/rm/deep-1: Likewise. * tests/rm/dir-no-w: Likewise. * tests/rm/dir-nonrecur: Likewise. * tests/rm/dot-rel: Likewise. * tests/rm/empty-inacc: Likewise. * tests/rm/f-1: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/hash: Likewise. * tests/rm/i-1: Likewise. * tests/rm/i-no-r: Likewise. * tests/rm/ignorable: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/interactive-always: Likewise. * tests/rm/interactive-once: Likewise. * tests/rm/ir-1: Likewise. * tests/rm/isatty: Likewise. * tests/rm/no-give-up: Likewise. * tests/rm/r-1: Likewise. * tests/rm/r-2: Likewise. * tests/rm/r-3: Likewise. * tests/rm/r-4: Likewise. * tests/rm/readdir-bug: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/rm/rm3: Likewise. * tests/rm/rm4: Likewise. * tests/rm/rm5: Likewise. * tests/rm/sunos-1: Likewise. * tests/rm/unread2: Likewise. * tests/rm/unread3: Likewise. * tests/rmdir/fail-perm: Likewise. * tests/rmdir/t-slash: Likewise. * tests/shred/exact: Likewise. * tests/shred/remove: Likewise. * tests/sum/sysv: Likewise. * tests/tail-2/append-only: Likewise. * tests/tail-2/assert: Likewise. * tests/tail-2/assert-2: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/fflush: Likewise. * tests/tail-2/infloop-1: Likewise. * tests/tail-2/proc-ksyms: Likewise. * tests/tail-2/start-middle: Likewise. * tests/tail-2/tail-n0f: Likewise. * tests/tee/basic: Likewise. * tests/tee/dash: Likewise. * tests/touch/fail-diag: Likewise. * tests/touch/no-create-missing: Likewise. * tests/touch/not-owner: Likewise. * tests/touch/obsolescent: Likewise. * tests/touch/read-only: Likewise. * tests/touch/relative: Likewise.
Diffstat (limited to 'tests/mv')
-rwxr-xr-xtests/mv/acl4
-rwxr-xr-xtests/mv/atomic4
-rwxr-xr-xtests/mv/backup-dir2
-rwxr-xr-xtests/mv/childproof4
-rwxr-xr-xtests/mv/diag4
-rwxr-xr-xtests/mv/dir-file4
-rwxr-xr-xtests/mv/dir2dir2
-rwxr-xr-xtests/mv/dup-source4
-rwxr-xr-xtests/mv/hard-24
-rwxr-xr-xtests/mv/hard-34
-rwxr-xr-xtests/mv/hard-44
-rwxr-xr-xtests/mv/hard-link-14
-rwxr-xr-xtests/mv/hard-verbose2
-rwxr-xr-xtests/mv/i-24
-rwxr-xr-xtests/mv/i-34
-rwxr-xr-xtests/mv/i-44
-rwxr-xr-xtests/mv/i-52
-rwxr-xr-xtests/mv/i-link-no2
-rwxr-xr-xtests/mv/into-self-44
-rwxr-xr-xtests/mv/leak-fd2
-rwxr-xr-xtests/mv/mv-special-14
-rwxr-xr-xtests/mv/no-target-dir2
-rwxr-xr-xtests/mv/part-fail4
-rwxr-xr-xtests/mv/part-hardlink4
-rwxr-xr-xtests/mv/part-rename4
-rwxr-xr-xtests/mv/part-symlink12
-rwxr-xr-xtests/mv/partition-perm4
-rwxr-xr-xtests/mv/perm-14
-rwxr-xr-xtests/mv/reply-no4
-rwxr-xr-xtests/mv/trailing-slash2
-rwxr-xr-xtests/mv/update4
31 files changed, 58 insertions, 58 deletions
diff --git a/tests/mv/acl b/tests/mv/acl
index 52c6fe130..b29f0e8ea 100755
--- a/tests/mv/acl
+++ b/tests/mv/acl
@@ -2,7 +2,7 @@
# move files/directories across file system boundaries
# and make sure acls are preserved
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
t0="$t0 $other_partition_tmpdir"
diff --git a/tests/mv/atomic b/tests/mv/atomic
index a03c4de58..bb761bdc4 100755
--- a/tests/mv/atomic
+++ b/tests/mv/atomic
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that mv doesn't first unlink its destination in one particular case
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/backup-dir b/tests/mv/backup-dir
index ea2c6b7d3..72ffce1eb 100755
--- a/tests/mv/backup-dir
+++ b/tests/mv/backup-dir
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/childproof b/tests/mv/childproof
index b6101d36e..41cdfce18 100755
--- a/tests/mv/childproof
+++ b/tests/mv/childproof
@@ -2,7 +2,7 @@
# Ensure that cp/mv don't clobber a just-copied file.
# With fileutils-4.1 and earlier, this test would fail.
-# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
tmp=childproof.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/diag b/tests/mv/diag
index c3aaa52e7..63eb3c628 100755
--- a/tests/mv/diag
+++ b/tests/mv/diag
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure we get proper diagnostics: e.g., with --target-dir=d but no args
-# Copyright (C) 2000, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
tmp=diag-$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/dir-file b/tests/mv/dir-file
index 417b51d53..9c540b293 100755
--- a/tests/mv/dir-file
+++ b/tests/mv/dir-file
@@ -1,7 +1,7 @@
#!/bin/sh
# mv must fail when src and dest are mismatched directory/non-directory.
-# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ fi
tmp=mv-mismatch-$$
pwd=`pwd`
-trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $tmp' 0 1 2 3 15
framework_failure=0
mkdir $tmp || framework_failure=1
diff --git a/tests/mv/dir2dir b/tests/mv/dir2dir
index 28462a44f..8518a6220 100755
--- a/tests/mv/dir2dir
+++ b/tests/mv/dir2dir
@@ -29,7 +29,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/dup-source b/tests/mv/dup-source
index b3d86daad..7965c91a5 100755
--- a/tests/mv/dup-source
+++ b/tests/mv/dup-source
@@ -4,7 +4,7 @@
# made this fail: cp a a d/
# Ensure that mv fails with a similar command.
-# Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
tmp=dup-src.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/hard-2 b/tests/mv/hard-2
index 7dcc6c34a..101f334d2 100755
--- a/tests/mv/hard-2
+++ b/tests/mv/hard-2
@@ -2,7 +2,7 @@
# Ensure that moving hard-linked arguments onto existing destinations works.
# Likewise when using cp --preserve=link.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/hard-3 b/tests/mv/hard-3
index b51411775..0ab9521fa 100755
--- a/tests/mv/hard-3
+++ b/tests/mv/hard-3
@@ -2,7 +2,7 @@
# Ensure that using `cp --preserve=link' to copy hard-linked arguments
# onto existing destinations works, even when one of the link operations fails.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -42,7 +42,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/hard-4 b/tests/mv/hard-4
index d44df0852..118479af0 100755
--- a/tests/mv/hard-4
+++ b/tests/mv/hard-4
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that mv removes a in this case: touch a; ln a b; mv a b
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/hard-link-1 b/tests/mv/hard-link-1
index 03327ad14..dc345f110 100755
--- a/tests/mv/hard-link-1
+++ b/tests/mv/hard-link-1
@@ -2,7 +2,7 @@
# move a directory containing hard-linked files and
# make sure the links are preserved
-# Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999, 2000, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/hard-verbose b/tests/mv/hard-verbose
index b46492e4a..9c02ac14d 100755
--- a/tests/mv/hard-verbose
+++ b/tests/mv/hard-verbose
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/i-2 b/tests/mv/i-2
index a3f51102b..ae7c5a135 100755
--- a/tests/mv/i-2
+++ b/tests/mv/i-2
@@ -2,7 +2,7 @@
# Test both cp and mv for their behavior with -if and -fi
# The standards (POSIX and SuS) dictate annoyingly inconsistent behavior.
-# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -34,7 +34,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
tmp=cp-mv-if-$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/i-3 b/tests/mv/i-3
index cd59e66ad..937479e42 100755
--- a/tests/mv/i-3
+++ b/tests/mv/i-3
@@ -2,7 +2,7 @@
# Make sure that `mv file unwritable-file' prompts the user
# and that `mv -f file unwritable-file' doesn't.
-# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
tmp=mv-i.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/i-4 b/tests/mv/i-4
index 7d547a1bd..594c155fb 100755
--- a/tests/mv/i-4
+++ b/tests/mv/i-4
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure `mv -i a b' does its job with a positive response
-# Copyright (C) 2001, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
tmp=mv-i4-$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/i-5 b/tests/mv/i-5
index 8b29545d8..2fec7edf7 100755
--- a/tests/mv/i-5
+++ b/tests/mv/i-5
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/i-link-no b/tests/mv/i-link-no
index 70208317d..2931af60e 100755
--- a/tests/mv/i-link-no
+++ b/tests/mv/i-link-no
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
tmp=i-link-no.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/into-self-4 b/tests/mv/into-self-4
index 4c94f20d9..13357b78d 100755
--- a/tests/mv/into-self-4
+++ b/tests/mv/into-self-4
@@ -2,7 +2,7 @@
# confirm that `mv symlink symlink' doesn't remove symlink
# Based on an example from David Luyer.
-# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
tmp=mv-slink2.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd
index 347aacfd9..5e5bb1a83 100755
--- a/tests/mv/leak-fd
+++ b/tests/mv/leak-fd
@@ -36,7 +36,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
if test -z "$other_partition_tmpdir"; then
diff --git a/tests/mv/mv-special-1 b/tests/mv/mv-special-1
index b4b42c5c6..dadcd697d 100755
--- a/tests/mv/mv-special-1
+++ b/tests/mv/mv-special-1
@@ -1,7 +1,7 @@
#! /bin/sh
# Test "mv" with special files.
-# Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005 Free Software
+# Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@ fi
pwd=`pwd`
tmp=mv-spec.$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
. $srcdir/setup
diff --git a/tests/mv/no-target-dir b/tests/mv/no-target-dir
index 36c2e0e86..cf4891c58 100755
--- a/tests/mv/no-target-dir
+++ b/tests/mv/no-target-dir
@@ -26,7 +26,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/part-fail b/tests/mv/part-fail
index c4aae78e4..2bbd9d247 100755
--- a/tests/mv/part-fail
+++ b/tests/mv/part-fail
@@ -4,7 +4,7 @@
# This is a bit fragile since it relies on the string used
# for EPERM: `permission denied'.
-# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
if test -z "$other_partition_tmpdir"; then
diff --git a/tests/mv/part-hardlink b/tests/mv/part-hardlink
index 9fb6c00cd..9a8eac770 100755
--- a/tests/mv/part-hardlink
+++ b/tests/mv/part-hardlink
@@ -4,7 +4,7 @@
# For additional constraints, see the comment in copy.c.
# Before coreutils-5.2.1, this test would fail.
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
if test -z "$other_partition_tmpdir"; then
diff --git a/tests/mv/part-rename b/tests/mv/part-rename
index 50df1c265..a4b361010 100755
--- a/tests/mv/part-rename
+++ b/tests/mv/part-rename
@@ -3,7 +3,7 @@
# another, and giving it a different name at the destination would cause mv
# to get a failed assertion.
-# Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
if test -z "$other_partition_tmpdir"; then
diff --git a/tests/mv/part-symlink b/tests/mv/part-symlink
index c7c6132ef..eb66779c6 100755
--- a/tests/mv/part-symlink
+++ b/tests/mv/part-symlink
@@ -2,7 +2,7 @@
# make sure cp and mv can handle many combinations of local and
# other-partition regular/symlink'd files.
-# Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ fi
pwd=`pwd`
tmp=part-sl.$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $tmp $other_partition_tmpdir && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
pwd_tmp=$pwd/$tmp
@@ -98,8 +98,8 @@ for copy in cp mv; do
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
+ 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`
@@ -124,13 +124,13 @@ for copy in cp mv; do
| sed \
-e '/^total /d' \
-e s,$other_partition_tmpdir/,, \
- -e s,$pwd_tmp/,, \
+ -e "s,$pwd_tmp/,," \
-e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`"
ls2="`cd $other_partition_tmpdir && ls -gG --ignore=.err . \
| sed \
-e '/^total /d' \
-e s,$other_partition_tmpdir/,, \
- -e s,$pwd_tmp/,, \
+ -e "s,$pwd_tmp/,," \
-e 's/^[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *[^ ]* *//'`"
echo "($ls) ($ls2)"
diff --git a/tests/mv/partition-perm b/tests/mv/partition-perm
index cf68aabd4..f510edf08 100755
--- a/tests/mv/partition-perm
+++ b/tests/mv/partition-perm
@@ -1,7 +1,7 @@
#!/bin/sh
# Make sure permissions are preserved when moving from one partition to another.
-# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ fi
pwd=`pwd`
dir=p-perm-$$
-trap "cd $pwd; rm -rf $dir $other_partition_tmpdir" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $dir $other_partition_tmpdir' 0 1 2 3 15
mkdir $dir
diff --git a/tests/mv/perm-1 b/tests/mv/perm-1
index d1b5276b8..1b9ab289a 100755
--- a/tests/mv/perm-1
+++ b/tests/mv/perm-1
@@ -2,7 +2,7 @@
# ensure that mv gives one diagnostic, not two, when failing
# due to lack of permissions
-# Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@ PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/reply-no b/tests/mv/reply-no
index ba45cc056..fa338c893 100755
--- a/tests/mv/reply-no
+++ b/tests/mv/reply-no
@@ -1,7 +1,7 @@
#!/bin/sh
# Ensure that `mv --reply=no f1 f2' works.
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
diff --git a/tests/mv/trailing-slash b/tests/mv/trailing-slash
index 96201cf12..b734624de 100755
--- a/tests/mv/trailing-slash
+++ b/tests/mv/trailing-slash
@@ -28,7 +28,7 @@ fi
pwd=`pwd`
tmp=mv-tslash.$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
. $srcdir/../envvar-check
diff --git a/tests/mv/update b/tests/mv/update
index 78bb7d2f8..6bf161efa 100755
--- a/tests/mv/update
+++ b/tests/mv/update
@@ -1,7 +1,7 @@
#!/bin/sh
# make sure --update works as advertised
-# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ fi
pwd=`pwd`
tmp=mv-update.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0