summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-09-25 09:58:00 +0000
committerJim Meyering <jim@meyering.net>2005-09-25 09:58:00 +0000
commitae296eb1955b96d23a8642d25b6fc799aba2fe71 (patch)
treede45e2321ef8a8d9048c7dbf7e08c1354af4f0eb
parent23b92992478a9193ae293684d00df1dfe4850bc6 (diff)
downloadcoreutils-ae296eb1955b96d23a8642d25b6fc799aba2fe71.tar.xz
Use newer trap and tmpdir-creation framework.
Fix apparent typos (s/files/file/) in inner loop.
-rwxr-xr-xtests/chmod/usage14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/chmod/usage b/tests/chmod/usage
index 11610d845..6f72c80f3 100755
--- a/tests/chmod/usage
+++ b/tests/chmod/usage
@@ -9,12 +9,12 @@ fi
. $srcdir/../lang-default
pwd=`pwd`
-tmp=equals.$$
-trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
+t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
+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
-mkdir $tmp || framework_failure=1
+mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
if test $framework_failure = 1; then
@@ -58,7 +58,7 @@ cases='
ug,+x f :
'
-all_files=`echo "$cases" | sed 's/.*://'`
+all_files=`echo "$cases" | sed 's/.*://'|sort -u`
old_IFS=$IFS
IFS='
@@ -77,8 +77,8 @@ for case in $cases; do
touch -- $files || framework_failure=1
chmod $args || fail=1
for file in $files; do
- rm -f -- $files && touch -- $files && rm -- $file || framework_failure=1
- chmod $args 2>/dev/null && fail=1
+ rm -f -- $file && touch -- $file && rm -- $file || framework_failure=1
+ chmod $args $file 2>/dev/null && fail=1
done
;;
esac