]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
This means that if multiple users are given on the command line, the
authorJim Meyering <jim@meyering.net>
Wed, 16 Jul 1997 13:46:53 +0000 (13:46 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 16 Jul 1997 13:46:53 +0000 (13:46 +0000)
error return code is that of the last, so earlier failures can't be
detected.

src/groups.sh

index 508e95a18c4cd45650c20456241bd3029028603d..be33f02a5fed942721e65c4de41959924616df8e 100755 (executable)
@@ -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