summaryrefslogtreecommitdiff
path: root/src/groups.sh
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-07-16 12:49:36 +0000
committerJim Meyering <jim@meyering.net>1997-07-16 12:49:36 +0000
commit74ed7c9f94e55ea81548b1aaa91056aee7d99a14 (patch)
tree0423527e67a87fce16f95611366d866b717ca0de /src/groups.sh
parentf46c35a7442293888e82c46cdd7d9d286ebda2f9 (diff)
downloadcoreutils-74ed7c9f94e55ea81548b1aaa91056aee7d99a14.tar.xz
Exit with status from `id' command.
Don't print `$name : $groups' if id fails. Reported by Austin Donnelly.
Diffstat (limited to 'src/groups.sh')
-rwxr-xr-xsrc/groups.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/groups.sh b/src/groups.sh
index d115d2a77..508e95a18 100755
--- a/src/groups.sh
+++ b/src/groups.sh
@@ -46,8 +46,12 @@ esac
if [ $# -eq 0 ]; then
id -Gn
+ status=$?
else
for name in "$@"; do
- echo $name : `id -Gn -- $name`
+ groups=`id -Gn -- $name`
+ status=$?
+ test $status = 0 && echo $name : $groups
done
fi
+exit $status