Ok, to excluse a userid (first field, no : in front) do
#!/bin/sh
TMP=`mktemp /tmp/group.XXXXXX`
grep -w :`grep "^${1}:" /etc/group | cut -d: -f3` /etc/passwd | cut
-d: -f1 > $TMP
grep "^${1}:" /etc/group | cut -d: -f4 | sed 's/,//g' >> $TMP
cat $TMP | uniq
rm -f $TMP
hth
charles
On Fri, 14 Jan 2000, William B. Herman wrote:
> Ok, I made little modification because if you were looking for a group id,
> say 10, and a person's group id was 100 it would include them (I just added
> the -w option after the first grep). Now, how can I make it so it doesn't
> include a user who's userid is the same as the groupid I am looking for ?
>
> Here is the code I have now:
>
> #!/bin/sh
> TMP=`mktemp /tmp/group.XXXXXX`
> grep -w `grep "^${1}:" /etc/group | cut -d: -f3` /etc/passwd | cut -d: -f1
> > $TMP
> grep "^${1}:" /etc/group | cut -d: -f4 | sed 's/,/\
> /g' >> $TMP
> cat $TMP | uniq
> rm -f $TMP
--
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.