From 57b38dad6b372346ab64775649b22c48619d4221 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 29 Apr 2005 21:49:06 +0000 Subject: Don't use 'set -'. Simplify test construction. Work even if the underyling system attaches ACLs to new dirs. --- tests/mkdir/perm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/mkdir/perm') diff --git a/tests/mkdir/perm b/tests/mkdir/perm index 8e3e97109..f325bb4b9 100755 --- a/tests/mkdir/perm +++ b/tests/mkdir/perm @@ -44,12 +44,14 @@ tests=' 027 : -m =+x : drwxr-x--- : d--x--x--- : - : - : last : last : ' +colon_tests=`echo $tests | sed 's/^ *//; s/ *: */:/g'` + for p in empty -p; do test _$p = _empty && p= old_IFS=$IFS IFS=':' - set - `(echo "$tests"|tr -d '\n'; echo)|sed 's/^ *//;s/ *:/:/g;s/: */:/g'` + set $colon_tests IFS=$old_IFS while :; do @@ -71,11 +73,11 @@ for p in empty -p; do mkdir $p $mode parent/sub || fail=1 - perms=`ls -ld parent | sed 's/ .*//'` + perms=`ls -ld parent | sed 's/ .*//; s/+$//'` test "$parent_perms" = "$perms" \ || { fail=1; echo parent: expected $parent_perms, got $perms; } - perms=`ls -ld parent/sub | sed 's/ .*//'` + perms=`ls -ld parent/sub | sed 's/ .*//; s/+$//'` test "$sub_perms" = "$perms" \ || { fail=1; echo parent/sub: expected $sub_perms, got $perms; } -- cgit v1.2.3-70-g09d2