diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-16 12:49:36 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-16 12:49:36 +0000 |
commit | 74ed7c9f94e55ea81548b1aaa91056aee7d99a14 (patch) | |
tree | 0423527e67a87fce16f95611366d866b717ca0de /src | |
parent | f46c35a7442293888e82c46cdd7d9d286ebda2f9 (diff) | |
download | coreutils-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')
-rwxr-xr-x | src/groups.sh | 6 |
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 |