diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-16 13:46:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-16 13:46:53 +0000 |
commit | 08bc7404bc5971053320e52972f602e9828f785c (patch) | |
tree | 65c248226461c941a1281c772e8142d9247b78d5 /src | |
parent | 78b6253deaf61b8a823da08826cea6f6ad030e18 (diff) | |
download | coreutils-08bc7404bc5971053320e52972f602e9828f785c.tar.xz |
This means that if multiple users are given on the command line, the
error return code is that of the last, so earlier failures can't be
detected.
Diffstat (limited to 'src')
-rwxr-xr-x | src/groups.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/groups.sh b/src/groups.sh index 508e95a18..be33f02a5 100755 --- a/src/groups.sh +++ b/src/groups.sh @@ -46,12 +46,17 @@ esac if [ $# -eq 0 ]; then id -Gn - status=$? + fail=$? else + fail=0 for name in "$@"; do groups=`id -Gn -- $name` status=$? - test $status = 0 && echo $name : $groups + if test $status = 0; then + echo $name : $groups + else + fail=$status + fi done fi -exit $status +exit $fail |