From 7eab9358e84ce8cf0433dcdbd12415a7c0b811ad Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 19 Apr 2022 16:53:50 -0400 Subject: implement groups command --- Makefile | 2 +- groups.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 groups.sh diff --git a/Makefile b/Makefile index 25b98f8..42f565a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .POSIX: -PROGRAMS=arch base64 factor hostid mktemp nproc pinky printenv readlink \ +PROGRAMS=arch base64 factor groups hostid mktemp nproc pinky printenv readlink \ seq shuf stat stdbuf sync tac uptime users vdir yes all: $(PROGRAMS) diff --git a/groups.sh b/groups.sh new file mode 100644 index 0000000..52606d2 --- /dev/null +++ b/groups.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ $# -eq 0 ]; then + exec id -Gn +fi + +while [ $# -gt 0 ]; do + printf '%s : ' $1 + id -Gn $1 + shift +done -- cgit v1.2.1