Hi If i am not wrong you want to grep the output of :
Quote:
grep ^mygroup /etc/group | cut -d: -f3
|
Suppose that group is root;then
Quote:
grep ^root /etc/group | cut -d: -f3
|
; will give output
Now if you grep 0
it gives output;
Quote:
root:x:0:0:root:/root:/bin/bash
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0perator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
mysql:x:27:480:MySQL Server:/var/lib/mysql:/bin/bash
qemu:x:107:107:qemu user:/:/sbin/nologin
smolt:x:490:474:Smolt:/usr/share/smolt:/sbin/nologin
|
i.e it lists all 0 like 107;480 etc.
What i am trying to say is if your group id is 111 then it will give even 1, 12 or 32 or 212 etc
So change the way you are using commands;better write script!