diff options
author | Jim Meyering <jim@meyering.net> | 2001-09-02 15:21:33 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-09-02 15:21:33 +0000 |
commit | f89de059895edf005a6a5bf5645f82eebf28b619 (patch) | |
tree | d932717b52347a7e7984c4ab897400cf7838aae5 /tests | |
parent | 5a3b6381c25f89c9f39663dbab43b56db5e7e1b1 (diff) | |
download | coreutils-f89de059895edf005a6a5bf5645f82eebf28b619.tar.xz |
Change usage not to use $1.
That's not portable to e.g., Solaris2.6's /bin/sh.
Communicate via an envvar instead.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/priv-check | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/priv-check b/tests/priv-check index 4b95f860f..b37f99632 100644 --- a/tests/priv-check +++ b/tests/priv-check @@ -2,10 +2,11 @@ # Source this file at the beginning of a test that works # only when run as root or as non-root. -case $1 in +case "$PRIV_CHECK_ARG" in require-root) who='as root';; require-non-root) who='by an unprivileged user';; - *) echo "Usage: $0 require-root|require-non-root" 1>&2; exit 1;; + *) echo "Usage: PRIV_CHECK_ARG={require-root|require-non-root} . priv-check"\ + 1>&2; exit 1;; esac priv_check_temp=priv-check.$$ @@ -15,7 +16,7 @@ chmod a-w $priv_check_temp || framework_failure=1 (echo foo >> $priv_check_temp) >/dev/null 2>&1 overwrite_status=$? give_msg=no -case $1:$overwrite_status in +case $PRIV_CHECK_ARG:$overwrite_status in require-root:0) ;; require-root:*) give_msg=yes ;; require-non-root:0) give_msg=yes ;; |