+2006-10-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * 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.
+
2006-10-21 Jim Meyering <jim@meyering.net>
* NEWS: (cp --backup fix): Fix a typo.
pwd=`pwd`
tmp=basic.$$
-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
#!/bin/sh
# see if chgrp can change the group of a symlink
-# Copyright (C) 2000, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
pwd=`pwd`
tmp=slink.$$
-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
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
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
#!/bin/sh
# ad-hoc tests of chgrp with -R and -H or -L and symlinks
-# Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2003, 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
pwd=`pwd`
tmp=recurse.$$
-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
#!/bin/sh
# Verify that chmod's --changes (-c) option works.
-# 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
pwd=`pwd`
tmp=c-option.$$
-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
cd $srcdir || framework_failure=1
abs_srcdir=`pwd`
-cd $pwd || framework_failure=1
+cd "$pwd" || framework_failure=1
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
#!/bin/sh
# Test "chmod =x" and the like.
-# Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation,
+# Copyright (C) 1999, 2000, 2002, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# This program is free software; you can redistribute it and/or modify
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
# Before fileutils-4.1.2, some of them didn't.
# Also, before coreutils-5.3.1, =[ugo] sometimes didn't work.
-# Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation,
+# Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# This program is free software; you can redistribute it and/or modify
pwd=`pwd`
tmp=equals.$$
-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
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
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
#!/bin/sh
# ensure that chmod diagnoses a certain type of invalid mode string
-# 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
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
pwd=`pwd`
tmp=setgid.$$
-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
#!/bin/sh
# Test that chmod -x file reports an error if the result is executable.
-# 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
pwd=`pwd`
tmp=minus.$$
-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
#!/bin/sh
# Verify that chmod works correctly with odd option combinations.
-# 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
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
#!/bin/sh
# make sure chown --from=... works
-# 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
pwd=`pwd`
tmp=basic.$$
-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
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
#!/bin/sh
# Make sure "chown USER:GROUP FILE" works, and similar tests with separators.
-# 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
framework_failure=0
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
#!/bin/sh
# Test cp backup.
-# Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
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
#!/bin/sh
# Test cp backup to source file.
-# Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation,
+# Copyright (C) 1998, 1999, 2000, 2002, 2004, 2006 Free Software Foundation,
# Inc.
# This program is free software; you can redistribute it and/or modify
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# test cp's -H and -L options
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
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
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
#!/bin/sh
# Test basic --backup functionality for both cp and mv.
-# Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1999, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# cp -R --parents dir-specified-with-trailing-slash/ other-dir
# would get a failed assertion.
-# Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# Record absolute path of srcdir and cd back to current dir.
cd $srcdir || framework_failure=1
abs_srcdir=`pwd`
-cd $pwd || framework_failure=1
+cd "$pwd" || framework_failure=1
. $srcdir/../envvar-check
. $srcdir/../umask-check
# Demonstrate bug when using -d with an existing destination file
# that is a symlink.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# verify that cp's --remove-destination option works with -R
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# Make sure that cp -R DIR1 DIR2 does the right thing
# when DIR1 is written with a trailing slash.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 || exit $?; exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 || exit $?; exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
#!/bin/sh
# A directory may not replace an existing file.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
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
#!/bin/sh
# Confirm that copying a directory into itself gets a proper diagnostic.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# Make sure cp --link -f works when the target exists.
# This failed for 4.0z (due to a bug introduced in that test release).
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
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
# ensure that `cp -d' preserves hard-links between command line arguments
# ensure that --preserve=links works with -RH and -RL
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-# Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-# Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# FIXME: This test requires ln -s.
# cp from 3.16 fails this test
-# Copyright (C) 1997, 1999, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# Make sure the permission-preserving code in copy.c (mv, cp, install) works.
-# Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# ensure that cp's --preserve=X,Y option is parsed properly
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# cp -r should not create symlinks. Fixed in fileutils-4.1.5.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; exec 1>&2; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && exec 1>&2; rm -rf $t0 && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
# `test cp --update A B' where A and B are both symlinks that point
# to the same file
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
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
# make sure `cp -p' preserves special bits
# This works only when run as root.
-# Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
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
# Make sure that cp -dR dereferences a symlink arg if its name is
# written with a trailing slash.
-# 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# Make sure dd does the right thing when the input file descriptor
# is not rewound.
-# 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
pwd=`pwd`
tmp=dd-rw.$$
-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
# show how to skip an amount that is smaller than the nominal block size.
# There's a more realistic example in the documentation.
-# 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
pwd=`pwd`
tmp=skip-seek.$$
-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
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
# Before coreutils-5.93, on systems with a signed, 32-bit stat.st_blocks
# one of du's computations would overflow.
-# 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
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
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
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
# prior to coreutils-4.5.3, du -D didn't work in some cases
# Based on an example from Andreas Schwab and/or Michal Svec.
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
# Ensure that --dereference-args (-D) gives reasonable names.
# This test would fail for coreutils-5.0.91.
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
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
#!/bin/sh
# make sure du's --exclude option works
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
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
#!/bin/sh
# check for file descriptor leak
-# 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
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
# Likewise for excluded directories.
# Ensure that hard links _are_ listed twice when using --count-links.
-# 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
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
# Ensure that even when run from an inaccessible directory, du can still
# operate on accessible directories elsewhere.
-# 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
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
fail=0
-du $pwd/$tmp/a > /dev/null || fail=1
+du "$pwd"/$tmp/a > /dev/null || fail=1
(exit $fail); exit $fail
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
fi
fail=0
-du -s $pwd/$tmp/$dir > /dev/null || fail=1
+du -s "$pwd"/$tmp/$dir > /dev/null || fail=1
(exit $fail); exit $fail
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
#!/bin/sh
# Ensure that by default, du doesn't dereference command-line symlinks.
-# 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
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
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
# due to a bug in glibc's ftw.c, in some cases, nftw w/FTW_CHDIR
# would not restore the working directory.
-# 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
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
#!/bin/sh
# `du /' would omit the `/' on the last line.
-# 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
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
#!/bin/sh
# Ensure that the size of a long-named-symlink is > 0.
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
# Ensure that du works properly for an argument that refers to a
# symbolic link, and that is specified with a trailing slash.
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
# Make sure `du d/1 d/2' works.
# That command failed with du from fileutils-4.0q.
-# 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
pwd=`pwd`
tmp=du2-$$
-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
#!/bin/sh
# make sure fmt -s works even on long lines
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
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
just_built_dd=$pwd/../../src/$dd
-test -r $just_built_dd || \
+test -r "$just_built_dd" || \
{
cat 1>&2 <<EOF
$0: WARNING!!!
exit 77
}
-cp $just_built_dd . || fail=1
+cp "$just_built_dd" . || fail=1
cp $dd $dd2 || fail=1
strip $dd2 || \
# hence cannot do anything meaningful with the following relative-named dirs.
abs=$pwd/$tmp
mkdir sub || fail=1
-(cd sub && chmod 0 . && ginstall -d $abs/xx/yy rel/sub1 rel/sub2 2> /dev/null) && fail=1
+(cd sub && chmod 0 . && ginstall -d "$abs"/xx/yy rel/sub1 rel/sub2 2> /dev/null) && fail=1
chmod 755 sub
# Ensure that the first argument-dir has been created.
# inaccessible parent. coreutils 5.97 fails this test.
mkdir -p sub1/d || fail=1
(cd sub1/d && chmod a-rx .. && chmod a-r . &&
- ginstall -d $abs/xx/zz rel/a rel/b 2> /dev/null) || fail=1
+ ginstall -d "$abs"/xx/zz rel/a rel/b 2> /dev/null) || fail=1
chmod 755 sub1 sub1/d || fail=1
test -d xx/zz || fail=1
test -d sub1/d/rel/a || fail=1
#! /bin/sh
# Test -D option.
-# 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
pwd=`pwd`
dir=install-D$$
-trap "cd $pwd; rm -rf $dir" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $dir' 0 1 2 3 15
mkdir $dir
#!/bin/sh
# Ensure that ginstall -d works with arguments specified with a trailing "/.".
-# 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
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
# Ensure that `install -s' doesn't infloop when its parent
# process traps CHLD signal.
-# 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
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
# 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=`$pwd/../../src/kill -l CHLD 2>/dev/null` && trap '' $sig
+ sig=`"$pwd"/../../src/kill -l CHLD 2>/dev/null` && trap '' $sig
# Before 2004-04-21, install would infloop, in the `while (wait...' loop:
- exec ginstall -s $pwd/../../src/ginstall$EXEEXT .
+ exec ginstall -s "$pwd"/../../src/ginstall$EXEEXT .
)
(exit $fail); exit $fail
#!/bin/sh
# Miscellaneous tests for "ln".
-# 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
pwd=`pwd`
tmp=t2-ln.$$
-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
mkdir $d || framework_failure=1
ln -s $d $ld
af=`pwd`/$f
-ln --no-dereference -fs $af $ld || fail=1
+ln --no-dereference -fs "$af" $ld || fail=1
test -f $ld || fail=1
rm -rf $d $f $ld
#!/bin/sh
# Test "ln --target-dir" with one file.
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
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
#!/bin/sh
# Make sure ls properly handles dangling symlinks vs. ls's -L, -H, options.
-# 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
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
#!/bin/sh
# make sure --dired option works
-# 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
pwd=`pwd`
tmp=dired.$$
-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
#!/bin/sh
# contrast ls -F, ls -p, and ls --indicator-style=file-type
-# Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
pwd=`pwd`
tmp=follow-sl.$$
-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
# show that the following no longer makes ls infloop
# mkdir loop; cd loop; ln -s ../loop sub; ls -RL
-# 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
pwd=`pwd`
tmp=infloop.$$
-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
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
#!/bin/sh
# exercise the -m option
-# 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
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
#!/bin/sh
# make sure ls and `ls -R' do the right thing when invoked with no arguments.
-# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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
pwd=`pwd`
tmp=no-args.$$
-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
# 4.1.1 and 4.1.2 had a bug whereby some recursive listings
# didn't include a blank line between per-directory groups of files.
-# 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
pwd=`pwd`
tmp=recursive.$$
-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
#!/bin/sh
# Make sure name is used as secondary key when sorting on mtime or ctime.
-# Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1998, 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
pwd=`pwd`
tmp=t-ls.$$
-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
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
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
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
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
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
rmdir e >&- || fail=1
touch e >&- || fail=1
sleep 0 >&- || fail=1
-$pwd/../../src/true >&- || fail=1
-$pwd/../../src/printf '' >&- || fail=1
+"$pwd"/../../src/true >&- || fail=1
+"$pwd"/../../src/printf '' >&- || fail=1
# If >&- works, ensure these fail, because stdout is closed and they
# *do* generate output. >&- apparently does not work in HP-UX 11.23.
# This test is ineffective unless /dev/stdout also works.
-if $pwd/../../src/test -w /dev/stdout >/dev/null &&
- $pwd/../../src/test ! -w /dev/stdout >&-; then
- $pwd/../../src/printf 'foo' >&- 2>/dev/null && fail=1
+if "$pwd"/../../src/test -w /dev/stdout >/dev/null &&
+ "$pwd"/../../src/test ! -w /dev/stdout >&-; then
+ "$pwd"/../../src/printf 'foo' >&- 2>/dev/null && fail=1
cp --verbose a b >&- 2>/dev/null && fail=1
fi
# Likewise for /dev/full, if /dev/full works.
if test -w /dev/full && test -c /dev/full; then
- $pwd/../../src/printf 'foo' >/dev/full 2>/dev/null && fail=1
+ "$pwd"/../../src/printf 'foo' >/dev/full 2>/dev/null && fail=1
cp --verbose a b >/dev/full 2>/dev/null && fail=1
fi
pwd=`pwd`
tmp=csplit.$$
-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
# `date --date="21:04 +0100" +%S' always prints `00'.
# Before coreutils-5.2.1, it would print the seconds from the current time.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
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
#!/bin/sh
# exercise the fix of 2001-08-18, based on test case from Ian Bruce
-# 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
pwd=`pwd`
tmp=head-c.$$
-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
# When reading a specified number of lines, ensure that the output
# file pointer is positioned just after those lines.
-# 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
pwd=`pwd`
tmp=head-pos.$$
-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
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
#!/bin/sh
# exercise nl functionality
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
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
#!/bin/sh
# pathchk tests
-# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# basic tests for printf
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
if test "$VERBOSE" = yes; then
set -x
- $prog --version
+ "$prog" --version
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
# This would fail (by printing the `--') for printf in sh-utils
# and in coreutils 4.5.1.
-$prog -- 'foo\n' > out || fail=1
+"$prog" -- 'foo\n' > out || fail=1
cat <<\EOF > exp
foo
EOF
rm -f out exp
# Until coreutils-4.5.10, this would elicit a segfault.
-$prog '1 %*sy\n' -3 x > out || fail=1
+"$prog" '1 %*sy\n' -3 x > out || fail=1
# Until coreutils 5.2.2, this would succeed.
-if POSIXLY_CORRECT=1 $prog '2 \x' >/dev/null 2>&1; then
+if POSIXLY_CORRECT=1 "$prog" '2 \x' >/dev/null 2>&1; then
fail=1
else
echo '2 failed, as expected' >> out
fi
# Until coreutils-4.5.12, these would fail.
-$prog '3 \x40\n' >> out || fail=1
+"$prog" '3 \x40\n' >> out || fail=1
POSIXLY_CORRECT=1 \
-$prog '4 \x40\n' >> out || fail=1
-$prog '5 % +d\n' 234 >> out || fail=1
+"$prog" '4 \x40\n' >> out || fail=1
+"$prog" '5 % +d\n' 234 >> out || fail=1
# This should print "6 !\n", but don't rely on `!' being the
# one-byte representation of octal 041. With printf prior to
# coreutils-5.0.1, it would print six bytes: "6 \41\n".
-$prog '6 \41\n' | tr '\41' '!' >> out
+"$prog" '6 \41\n' | tr '\41' '!' >> out
# Note that as of coreutils-5.0.1, printf with a format of '\0002x'
# prints a NUL byte followed by the digit `2' and an `x'.
# By contrast bash's printf outputs the same thing as $(printf '\2x') does.
-$prog '7 \2y \02y \002y \0002y\n' |tr '\0\2' '*=' >> out
+"$prog" '7 \2y \02y \002y \0002y\n' |tr '\0\2' '*=' >> out
-$prog '8 %b %b %b %b\n' '\1y' '\01y' '\001y' '\0001y'|tr '\1' = >> out
+"$prog" '8 %b %b %b %b\n' '\1y' '\01y' '\001y' '\0001y'|tr '\1' = >> out
-$prog '9 %*dx\n' -2 0 >>out || fail=1
+"$prog" '9 %*dx\n' -2 0 >>out || fail=1
-$prog '10 %.*dx\n' -2147483648 0 >>out || fail=1
+"$prog" '10 %.*dx\n' -2147483648 0 >>out || fail=1
-$prog '11 %*c\n' 2 x >>out || fail=1
+"$prog" '11 %*c\n' 2 x >>out || fail=1
-$prog '%#d\n' 0 >>out 2> /dev/null && fail=1
+"$prog" '%#d\n' 0 >>out 2> /dev/null && fail=1
-$prog '%0s\n' 0 >>out 2> /dev/null && fail=1
+"$prog" '%0s\n' 0 >>out 2> /dev/null && fail=1
-$prog '%.9c\n' 0 >>out 2> /dev/null && fail=1
+"$prog" '%.9c\n' 0 >>out 2> /dev/null && fail=1
-$prog '%'\''s\n' 0 >>out 2> /dev/null && fail=1
+"$prog" '%'\''s\n' 0 >>out 2> /dev/null && fail=1
cat <<\EOF > exp
1 x y
#!/bin/sh
# make sure that only two hex. digits are consumed in a \xHHH sequence
-# 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
if test "$VERBOSE" = yes; then
set -x
- $prog --version
+ "$prog" --version
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
fail=0
-$prog '\x7e3\n' > out || fail=1
+"$prog" '\x7e3\n' > out || fail=1
cat <<\EOF > exp
~3
EOF
}
framework_failure=0
-pwd=`${BUILD_SRC_DIR?}/pwd` || framework_failure=1
+pwd=`"${BUILD_SRC_DIR?}"/pwd` || framework_failure=1
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
mkdir -p $tmp || framework_failure=1
my $pwd_binary = "$build_src_dir/pwd";
-x $pwd_binary
or die "$ME: $pwd_binary is not an executable file\n";
-chomp (my $actual = `$pwd_binary`);
+chomp (my $actual = `"$pwd_binary"`);
if ($expected ne $actual)
{
my $e_len = length $expected;
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
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
#!/bin/sh
# Show that split -a works.
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
pwd=`pwd`
tmp=split-a.$$
-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
#!/bin/sh
# split must fail when given length/count of zero.
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
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
#!/bin/sh
# show that `split --lines=2' works.
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# ensure that stat properly handles a format string ending with %
-# 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
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
# when it encounters an error with say the first one.
# With coreutils-5.2.1 and earlier, this test would fail.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
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
#!/bin/sh
# Test whether "mkdir -p" works concurrently.
-# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2002, 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
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
-mkdir --parents $pwd/$tmp/a/b/c || fail=1
+mkdir --parents "$pwd"/$tmp/a/b/c || fail=1
test -d $tmp || fail=1
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
-mkdir --parents $pwd/$tmp || fail=1
+mkdir --parents "$pwd"/$tmp || fail=1
test -d $tmp || fail=1
#!/bin/sh
# Just like p-1, but with an absolute path.
-# Copyright (C) 1997, 2000, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1997, 2000, 2002, 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
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
mkdir --parents $tmp || fail=1
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
fi
p=$pwd/$tmp
-(cd no-access && chmod 0 . && mkdir -p $p/a/b u/v) 2> /dev/null && fail=1
-test -d $p/a/b || fail=1
+(cd no-access && chmod 0 . && mkdir -p "$p"/a/b u/v) 2> /dev/null && fail=1
+test -d "$p"/a/b || fail=1
# Same as above, but with a following *absolute* name, it should succeed
-(cd no-acce2s && chmod 0 . && mkdir -p $p/b/b $p/z) || fail=1
-test -d $p/b/b && test -d $p/z || fail=1
+(cd no-acce2s && chmod 0 . && mkdir -p "$p"/b/b "$p"/z) || fail=1
+test -d "$p"/b/b && test -d "$p"/z || fail=1
# Same as above, but a trailing relative name in an unreadable directory
# whose parent is inaccessible. coreutils 5.97 fails this test.
-(cd no-acce3s/d && chmod a-rx .. && chmod a-r . && mkdir -p a/b $p/b/c d/e &&
+(cd no-acce3s/d && chmod a-rx .. && chmod a-r . && mkdir -p a/b "$p"/b/c d/e &&
test -d a/b && test -d d/e) || fail=1
-test -d $p/b/c || fail=1
+test -d "$p"/b/c || fail=1
-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
#!/bin/sh
# Ensure that mkdir -p works with arguments specified with a trailing "/.".
-# 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
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
#!/bin/sh
# Ensure that mkdir -p foo/bar works when foo is a symbolic link to a directory
-# 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
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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
#!/bin/sh
# make sure mkdir's -p options works properly
-# 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
pwd=`pwd`
tmp=parents-$$
-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
cd $srcdir || framework_failure=1
abs_srcdir=`pwd`
-cd $pwd || framework_failure=1
+cd "$pwd" || framework_failure=1
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
mkdir -m 700 e-dir || framework_failure=1
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
# Record absolute path of srcdir and cd back to current dir.
cd $srcdir || framework_failure=1
abs_srcdir=`pwd`
-cd $pwd || framework_failure=1
+cd "$pwd" || framework_failure=1
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
# Ensure that mkdir works with arguments specified with and without
# a trailing slash.
-# 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
pwd=`pwd`
tmp=t-slash.$$
-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
# 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
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"
#!/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
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
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
# 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
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
#!/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
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
#!/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
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
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
# 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
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
# 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
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
# 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
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
#!/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
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
# 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
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
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
# 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
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
# 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
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
#!/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
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
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
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
# 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
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
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
#! /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
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
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
# 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
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
# 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
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
# 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
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
# 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
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
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`
| 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)"
#!/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
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
# 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
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
#!/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
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
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
#!/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
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
#!/bin/sh
# Verify that `od -N N' reads no more than N bytes of input.
-# Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001, 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
pwd=`pwd`
tmp=od-N.$$
-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
# verify that od -t x8 works properly
# This would fail before coreutils-4.5.2.
-# Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# tests for canonicalize-existing mode (readlink -e).
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=1
while :; do
- bindir=`cd ../../src; pwd`|| break
- my_pwd=`$bindir/pwd` || break
+ bindir=`cd ../../src && pwd`|| break
+ my_pwd=`"$bindir"/pwd` || break
mkdir -p $tmp || break
cd $tmp || break
for p in "" "$pwd/$tmp/"; do
fail=1
- v=`readlink -e ${p}regfile` || break
+ v=`readlink -e "${p}"regfile` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -e ${p}./regfile/` && break
+ v=`readlink -e "${p}"./regfile/` && break
test -z "$v" || break
- v=`readlink -e ${p}subdir` || break
+ v=`readlink -e "${p}"subdir` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -e ${p}./subdir/` || break
+ v=`readlink -e "${p}"./subdir/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -e ${p}missing` && break
+ v=`readlink -e "${p}"missing` && break
test -z "$v" || break
- v=`readlink -e ${p}./missing/` && break
+ v=`readlink -e "${p}"./missing/` && break
test -z "$v" || break
- v=`readlink -e ${p}link1` || break
+ v=`readlink -e "${p}"link1` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -e ${p}./link1/` && break
+ v=`readlink -e "${p}"./link1/` && break
test -z "$v" || break
- v=`readlink -e ${p}link1/more` && break
+ v=`readlink -e "${p}"link1/more` && break
test -z "$v" || break
- v=`readlink -e ${p}link2` || break
+ v=`readlink -e "${p}"link2` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -e ${p}./link2/` || break
+ v=`readlink -e "${p}"./link2/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -e ${p}link2/more` && break
+ v=`readlink -e "${p}"link2/more` && break
test -z "$v" || break
- v=`readlink -e ${p}link3` && break
+ v=`readlink -e "${p}"link3` && break
test -z "$v" || break
- v=`readlink -e ${p}./link3/` && break
+ v=`readlink -e "${p}"./link3/` && break
test -z "$v" || break
- v=`readlink -e ${p}link3/more` && break
+ v=`readlink -e "${p}"link3/more` && break
test -z "$v" || break
- v=`readlink -e ${p}link4` && break
+ v=`readlink -e "${p}"link4` && break
test -z "$v" || break
- v=`readlink -e ${p}./link4/` && break
+ v=`readlink -e "${p}"./link4/` && break
test -z "$v" || break
- v=`readlink -e ${p}link4/more` && break
+ v=`readlink -e "${p}"link4/more` && break
test -z "$v" || break
fail=0
#!/bin/sh
# tests for canonicalize mode (readlink -f).
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=1
while :; do
- bindir=`cd ../../src; pwd`|| break
- my_pwd=`$bindir/pwd` || break
+ bindir=`cd ../../src && pwd`|| break
+ my_pwd=`"$bindir"/pwd` || break
mkdir -p $tmp || break
cd $tmp || break
for p in "" "$pwd/$tmp/"; do
fail=1
- v=`readlink -f ${p}regfile` || break
+ v=`readlink -f "${p}"regfile` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -f ${p}./regfile/` && break
+ v=`readlink -f "${p}"./regfile/` && break
test -z "$v" || break
- v=`readlink -f ${p}regfile/more` && break
+ v=`readlink -f "${p}"regfile/more` && break
test -z "$v" || break
- v=`readlink -f ${p}./regfile/more/` && break
+ v=`readlink -f "${p}"./regfile/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}subdir` || break
+ v=`readlink -f "${p}"subdir` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -f ${p}./subdir/` || break
+ v=`readlink -f "${p}"./subdir/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -f ${p}subdir/more` || break
+ v=`readlink -f "${p}"subdir/more` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -f ${p}./subdir/more/` && break
+ v=`readlink -f "${p}"./subdir/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}missing` || break
+ v=`readlink -f "${p}"missing` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -f ${p}./missing/` && break
+ v=`readlink -f "${p}"./missing/` && break
test -z "$v" || break
- v=`readlink -f ${p}missing/more` && break
+ v=`readlink -f "${p}"missing/more` && break
test -z "$v" || break
- v=`readlink -f ${p}./missing/more/` && break
+ v=`readlink -f "${p}"./missing/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}link1` || break
+ v=`readlink -f "${p}"link1` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -f ${p}./link1/` && break
+ v=`readlink -f "${p}"./link1/` && break
test -z "$v" || break
- v=`readlink -f ${p}link1/more` && break
+ v=`readlink -f "${p}"link1/more` && break
test -z "$v" || break
- v=`readlink -f ${p}./link1/more/` && break
+ v=`readlink -f "${p}"./link1/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}link2` || break
+ v=`readlink -f "${p}"link2` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -f ${p}./link2/` || break
+ v=`readlink -f "${p}"./link2/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -f ${p}link2/more` || break
+ v=`readlink -f "${p}"link2/more` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -f ${p}./link2/more/` && break
+ v=`readlink -f "${p}"./link2/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}link2/more/more2` && break
+ v=`readlink -f "${p}"link2/more/more2` && break
test -z "$v" || break
- v=`readlink -f ${p}./link2/more/more2/` && break
+ v=`readlink -f "${p}"./link2/more/more2/` && break
test -z "$v" || break
- v=`readlink -f ${p}link3` || break
+ v=`readlink -f "${p}"link3` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -f ${p}./link3/` && break
+ v=`readlink -f "${p}"./link3/` && break
test -z "$v" || break
- v=`readlink -f ${p}link3/more` && break
+ v=`readlink -f "${p}"link3/more` && break
test -z "$v" || break
- v=`readlink -f ${p}./link3/more/` && break
+ v=`readlink -f "${p}"./link3/more/` && break
test -z "$v" || break
- v=`readlink -f ${p}link4` || break
+ v=`readlink -f "${p}"link4` || break
test "$v" = "$my_pwd/$tmp/subdir/missing" || break
- v=`readlink -f ${p}./link4/` && break
+ v=`readlink -f "${p}"./link4/` && break
test -z "$v" || break
- v=`readlink -f ${p}link4/more` && break
+ v=`readlink -f "${p}"link4/more` && break
test -z "$v" || break
fail=0
#!/bin/sh
# tests for canonicalize-missing mode (readlink -m).
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=1
while :; do
- bindir=`cd ../../src; pwd`|| break
- my_pwd=`$bindir/pwd` || break
+ bindir=`cd ../../src && pwd`|| break
+ my_pwd=`"$bindir"/pwd` || break
mkdir -p $tmp || break
cd $tmp || break
for p in "" "$pwd/$tmp/"; do
fail=1
- v=`readlink -m ${p}regfile` || break
+ v=`readlink -m "${p}"regfile` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -m ${p}./regfile/` || break
+ v=`readlink -m "${p}"./regfile/` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -m ${p}regfile/more` || break
+ v=`readlink -m "${p}"regfile/more` || break
test "$v" = "$my_pwd/$tmp/regfile/more" || break
- v=`readlink -m ${p}./regfile/more/` || break
+ v=`readlink -m "${p}"./regfile/more/` || break
test "$v" = "$my_pwd/$tmp/regfile/more" || break
- v=`readlink -m ${p}subdir` || break
+ v=`readlink -m "${p}"subdir` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -m ${p}./subdir/` || break
+ v=`readlink -m "${p}"./subdir/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -m ${p}subdir/more` || break
+ v=`readlink -m "${p}"subdir/more` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -m ${p}./subdir/more/` || break
+ v=`readlink -m "${p}"./subdir/more/` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -m ${p}missing` || break
+ v=`readlink -m "${p}"missing` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -m ${p}./missing/` || break
+ v=`readlink -m "${p}"./missing/` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -m ${p}missing/more` || break
+ v=`readlink -m "${p}"missing/more` || break
test "$v" = "$my_pwd/$tmp/missing/more" || break
- v=`readlink -m ${p}./missing/more/` || break
+ v=`readlink -m "${p}"./missing/more/` || break
test "$v" = "$my_pwd/$tmp/missing/more" || break
- v=`readlink -m ${p}link1` || break
+ v=`readlink -m "${p}"link1` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -m ${p}./link1/` || break
+ v=`readlink -m "${p}"./link1/` || break
test "$v" = "$my_pwd/$tmp/regfile" || break
- v=`readlink -m ${p}link1/more` || break
+ v=`readlink -m "${p}"link1/more` || break
test "$v" = "$my_pwd/$tmp/regfile/more" || break
- v=`readlink -m ${p}./link1/more/` || break
+ v=`readlink -m "${p}"./link1/more/` || break
test "$v" = "$my_pwd/$tmp/regfile/more" || break
- v=`readlink -m ${p}link2` || break
+ v=`readlink -m "${p}"link2` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -m ${p}./link2/` || break
+ v=`readlink -m "${p}"./link2/` || break
test "$v" = "$my_pwd/$tmp/subdir" || break
- v=`readlink -m ${p}link2/more` || break
+ v=`readlink -m "${p}"link2/more` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -m ${p}./link2/more/` || break
+ v=`readlink -m "${p}"./link2/more/` || break
test "$v" = "$my_pwd/$tmp/subdir/more" || break
- v=`readlink -m ${p}link2/more/more2` || break
+ v=`readlink -m "${p}"link2/more/more2` || break
test "$v" = "$my_pwd/$tmp/subdir/more/more2" || break
- v=`readlink -m ${p}./link2/more/more2/` || break
+ v=`readlink -m "${p}"./link2/more/more2/` || break
test "$v" = "$my_pwd/$tmp/subdir/more/more2" || break
- v=`readlink -m ${p}link3` || break
+ v=`readlink -m "${p}"link3` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -m ${p}./link3/` || break
+ v=`readlink -m "${p}"./link3/` || break
test "$v" = "$my_pwd/$tmp/missing" || break
- v=`readlink -m ${p}link3/more` || break
+ v=`readlink -m "${p}"link3/more` || break
test "$v" = "$my_pwd/$tmp/missing/more" || break
- v=`readlink -m ${p}./link3/more/` || break
+ v=`readlink -m "${p}"./link3/more/` || break
test "$v" = "$my_pwd/$tmp/missing/more" || break
- v=`readlink -m ${p}link4` || break
+ v=`readlink -m "${p}"link4` || break
test "$v" = "$my_pwd/$tmp/subdir/missing" || break
- v=`readlink -m ${p}./link4/` || break
+ v=`readlink -m "${p}"./link4/` || break
test "$v" = "$my_pwd/$tmp/subdir/missing" || break
- v=`readlink -m ${p}link4/more` || break
+ v=`readlink -m "${p}"link4/more` || break
test "$v" = "$my_pwd/$tmp/subdir/missing/more" || break
- v=`readlink -m ${p}./link4/more/` || break
+ v=`readlink -m "${p}"./link4/more/` || break
test "$v" = "$my_pwd/$tmp/subdir/missing/more" || break
fail=0
#!/bin/sh
# test for readlink mode.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=1
#!/bin/sh
# rm (coreutils-4.5.4) could be tricked into mistakenly reporting a cycle.
-# 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
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
# But for fileutils-4.1.9, it would do the former and
# for fileutils-4.1.10 the latter.
-# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
umask 022
# rm (without -r) must give a diagnostic for any directory.
# It must not prompt, even if that directory is unwritable.
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
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
# Ensure that `rm dir' (i.e., without --recursive) gives a reasonable
# diagnostic when failing.
-# 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
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
# Use rm -r to remove two non-empty dot-relative directories.
# This would have failed between 2004-10-18 and 2004-10-21.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
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
#!/bin/sh
# Test "rm -f" with a nonexistent file.
-# Copyright (C) 1997, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
test_failure=0
# Like fail-eperm, but the failure must be for a file encountered
# while trying to remove the containing directory with the sticky bit set.
-# 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
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
# Before then, rm would fail occasionally, sometimes via
# a failed assertion, others with a seg fault.
-# Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 || exit $?; exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 || exit $?; exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
test_failure=0
# recurse into directory DIR. rm -i (without -r) must fail in that case.
# Fixed in coreutils-4.5.2.
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
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
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
p=$pwd/$tmp
set +x
-(cd no-access; chmod 0 . && rm -r $p/abs1 rel $p/abs2) 2> out && fail=1
-test -d $p/abs1 && fail=1
-test -d $p/abs2 && fail=1
+(cd no-access; chmod 0 . && rm -r "$p"/abs1 rel "$p"/abs2) 2> out && fail=1
+test -d "$p"/abs1 && fail=1
+test -d "$p"/abs2 && fail=1
cat <<\EOF > exp || fail=1
rm: cannot remove `rel': Permission denied
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
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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
test_failure=0
#!/bin/sh
# Make sure `chown 0 f; rm f' prompts before removing f.
-# Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# This program is free software; you can redistribute it and/or modify
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
# With rm from coreutils-5.2.1 and earlier, `rm -r' would mistakenly
# give up too early under some conditions.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
fail=0
# This must fail, since `.' is not writable by $NON_ROOT_USERNAME.
-setuidgid $NON_ROOT_USERNAME env PATH=$PATH rm -rf d 2>/dev/null && fail=1
+setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf d 2>/dev/null && fail=1
# d must remain.
test -d d || fail=1
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 || exit $?; exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 || exit $?; exit $status' 0
trap 'exit $?' 1 2 13 15
framework_failure=0
#!/bin/sh
# Create and remove a directory with more than 254 files.
-# Copyright (C) 1997, 2001, 2002, 2003, 2004 Free Software Foundation,
+# Copyright (C) 1997, 2001, 2002, 2003, 2004, 2006 Free Software Foundation,
# Inc.
# This program is free software; you can redistribute it and/or modify
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_fail=0
test -f 0a || framework_fail=1
test -f by || framework_fail=1
-cd $pwd || framework_fail=1
+cd "$pwd" || framework_fail=1
if test $framework_fail = 1; then
echo 'failure in testing framework'
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
cd $tmp || framework_failure=1
touch a || framework_failure=1
-cd $pwd || framework_failure=1
+cd "$pwd" || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework'
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
#!/bin/sh
# exercise another small part of remove.c
-# 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
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
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
#!/bin/sh
# exercise another small part of remove.c
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# ensure that `rm dir' fails without --recursive
-# 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
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
#!/bin/sh
# a basic test of rm -ri
-# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# Make sure that rm -r '' fails.
-# Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 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
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
+trap 'status=$?; cd "$pwd" && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
#!/bin/sh
# exercise one small part of remove.c
-# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 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
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
#!/bin/sh
# Ensure that rm works even from an unreadable working directory.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
t=$pwd/$tmp
# With coreutils-5.2.1, this would get a failed assertion.
-rm -r $t/a $t/b || fail=1
+rm -r "$t"/a "$t"/b || fail=1
# With coreutils-5.2.1, this would get the following:
# rm: cannot get current directory: Permission denied
# rm: failed to return to initial working directory: Bad file descriptor
-rm -r $t/d $t/e || fail=1
+rm -r "$t"/d "$t"/e || fail=1
-test -d $t/a && fail=1
-test -d $t/b && fail=1
-test -d $t/d && fail=1
-test -d $t/e && fail=1
+test -d "$t"/a && fail=1
+test -d "$t"/b && fail=1
+test -d "$t"/d && fail=1
+test -d "$t"/e && fail=1
(exit $fail); exit $fail
# For unwritable directory `d', `rmdir -p d d/e/f' would emit
# diagnostics but would not fail. Fixed in 5.1.2.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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
#!/bin/sh
# make sure rmdir -p works on a directory specified with a trailing slash
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
#!/bin/sh
# FIXME
-# Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2002, 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
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
#!/bin/sh
# make sure that neither --exact nor --zero gobbles a command line argument
-# 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
pwd=`pwd`
tmp=exact.$$
-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
#!/bin/sh
# Exercise a bug that was fixed in shred-4.0l
-# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
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
#!/bin/sh
# make sure `sum -s' works for input whose sum of bytes is larger than 2^32
-# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
pwd=`pwd`
tmp=sum-s.$$
-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
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
tmp=tail-assert.$$
pwd=`pwd`
-trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $tmp' 0 1 2 3 15
test_failure=0
mkdir $tmp || test_failure=1
# Due to a race condition in the test, the `assert' script would get
# the UMR on Solaris only some of the time, and not at all on Linux/GNU.
-# 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
tmp=tail-as2.$$
pwd=`pwd`
-trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $tmp' 0 1 2 3 15
test_failure=0
mkdir $tmp || test_failure=1
# Demonstrate a bug in `tail -cN' when operating on files of size 4G and larger
# Fixed in coreutils-4.5.2.
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 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
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
# The problem was that using the solaris5.7 setvbuf function to turn off
# buffering doesn't flush stdout.
-# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 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
tmp=tail-flush.$$
pwd=`pwd`
-trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $tmp' 0 1 2 3 15
test_failure=0
mkdir $tmp || test_failure=1
#!/bin/sh
# This test would fail with tail from pre-1.22i textutils.
-# Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002, 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
tmp=tail-inf1.$$
pwd=`pwd`
-trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
+trap 'cd "$pwd" && rm -rf $tmp' 0 1 2 3 15
test_failure=0
mkdir $tmp || test_failure=1
pwd=`pwd`
tmp=proc-ksyms.$$
-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
fail=0
# Verify that tail works even when it's reading from a file
# that is not at its beginning. Based on a report from John Roll.
-# 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
pwd=`pwd`
tmp=tail-mid.$$
-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
# Make sure that `tail -n0 -f' and `tail -c0 -f' sleep
# rather than doing what amounted to a busy-wait.
-# 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
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
#!/bin/sh
# test for basic tee functionality.
-# 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=0
#!/bin/sh
# test for "tee -".
-# 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
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 'status=$?; (exit $status); exit $status' 1 2 13 15
fail=0
#!/bin/sh
# make sure touch gives reasonable diagnostics
-# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 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
pwd=`pwd`
tmp=fail-diag.$$
-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
pwd=`pwd`
tmp=`echo "$0"|sed 's,.*/,,'`.tmp
-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
# If >&- works, test "touch -c -" etc.
# >&- apparently does not work in HP-UX 11.23.
# This test is ineffective unless /dev/stdout also works.
-if $pwd/../../src/test -w /dev/stdout >/dev/null &&
- $pwd/../../src/test ! -w /dev/stdout >&-; then
+if "$pwd"/../../src/test -w /dev/stdout >/dev/null &&
+ "$pwd"/../../src/test ! -w /dev/stdout >&-; then
touch -c - >&- 2> /dev/null || fail=1
touch -cm - >&- 2> /dev/null || fail=1
touch -ca - >&- 2> /dev/null || fail=1
# Make sure that touch gives reasonable diagnostics when applied
# to an unwritable directory owned by some other user.
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
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
#!/bin/sh
# Test touch with obsolescent 8- or 10-digit time stamps.
-# Copyright (C) 2000, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2000, 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
pwd=`pwd`
tmp=obsol.$$
-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
#!/bin/sh
# ensure that touch can operate on read-only files
-# 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
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
# Demonstrate using a combination of --reference and --date to
# set the time of a file back by an arbitrary amount.
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 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
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