summaryrefslogtreecommitdiff
path: root/tests/touch
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-07-01 14:36:57 +0000
committerJim Meyering <jim@meyering.net>2002-07-01 14:36:57 +0000
commit58c37faa5c7704574bf8b77687753c23b5a6663f (patch)
tree4849fc4a7448924d37ab261e6ea26c60b0bca7d9 /tests/touch
parentbec7e2c43281612f040ac82a9449d6b1a23e4ba0 (diff)
downloadcoreutils-58c37faa5c7704574bf8b77687753c23b5a6663f.tar.xz
Handle yet another different diagnostic.
Diffstat (limited to 'tests/touch')
-rwxr-xr-xtests/touch/fail-diag20
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag
index 6e2b49a16..bf77caa5a 100755
--- a/tests/touch/fail-diag
+++ b/tests/touch/fail-diag
@@ -33,19 +33,17 @@ touch / > out 2>&1 && fail=1
touch /no/such-dir >> out 2>&1 && fail=1
-cat > exp <<\EOF
-touch: setting times of `/': Permission denied
-touch: creating `/no/such-dir': No such file or directory
+# On SunOS4, EPERM is `Not owner'.
+# On some *BSD systems it's `Operation not permitted'.
+for msg in 'Not owner' 'Operation not permitted' 'Permission denied'; do
+ cat > exp <<EOF
+ touch: setting times of \`/': $msg
+ touch: creating \`/no/such-dir': No such file or directory
EOF
-cmp out exp || {
- # On SunOS4, EPERM is `Not owner'
- cat > exp2 <<\EOF
-touch: setting times of `/': Not owner
-touch: creating `/no/such-dir': No such file or directory
-EOF
- cmp out exp2 || fail=1
-}
+ cmp out exp > /dev/null 2>&1 && break
+
+done
test $fail = 1 && diff out exp 2> /dev/null