summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/groups.sh11
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