From: Jim Meyering Date: Wed, 16 Jul 1997 13:46:53 +0000 (+0000) Subject: This means that if multiple users are given on the command line, the X-Git-Tag: SH-UTILS-1_16d~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08bc7404bc5971053320e52972f602e9828f785c;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/groups.sh b/src/groups.sh index 508e95a18c..be33f02a5f 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