Keep on, really; it's kinda amusing.

On Dec 15 09:17:35, OpenBSD Geek wrote:
> After correction, i'm agree it is a bit long, but it works.
> Thank you very much for your posts!
> 
> if [ $1 ] & [ $2 ]; then

No.

Create a tempfile:

> tempfile=`mktemp /tmp/tempfile.XXXX`
> cp /etc/group $tempfile

Separate all groups into two classes: those whose name begins with $2 ...

> onlygroup=`mktemp /tmp/tempfile.XXXX`
> cat $tempfile | grep ^$2 > $onlygroup

... and the rest:

> nogroup=`mktemp /tmp/tempfile.XXXX`
> cat $tempfile | grep -v ^$2 > $nogroup

Remove all occurences of the string '$1' from any line
in the first class, and add the result to the second class:

> cat $onlygroup | sed "s/$1//g" | \
>         sed "s/ /,/g" | sed "s/,,/,/g" | sed "s/,$//g" >> $nogroup

Put some fun into the usually boring question of group membership:

> mv /etc/group /etc/group.old

Fuck the poor sods who happened to have '$1' in their name.
(For example, fire the Scottish as easilly as 'sh duig "mac" staff'):

> cp $nogroup /etc/group

Fuck install(1):

> chmod 644 /etc/group
> chown root /etc/group
> chgrp wheel /etc/group

Screw everybody's tempfiles:

> rm -f /tmp/tempfile.????

Keep it up.

Reply via email to