pkgsrc/sysutils/user_irix/files/groupdel.sh
cheusov 0c4d93a6de This implements a subset of useradd(8)/groupadd(8) functionality on
IRIX that is sufficient for pkgsrc use.
2011-05-07 15:43:13 +00:00

24 lines
395 B
Bash
Executable file

#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH
show_usage () {
echo "usage: $0 [v] group" >&2
exit 1
}
while getopts 'v' f; do
case $f in
v) ;; # ignored
\?) show_usage;;
esac
done
shift $(($OPTIND - 1))
if test $# -ne 1; then
show_usage
fi
cp -p /etc/group /etc/group.tmp
awk -F: -v name="$1" '$1 != name' /etc/group > /etc/group.tmp
mv /etc/group.tmp /etc/group