I need a bash script that will modify /etc/group to append and delete NIS users to specific local groups on a Solaris 10u8 system. Preferable one or two functions with uid and groupname as varibles.
inputfile before adding a user myuser to groupbbb in file /etc/group
...
groupaaa::98000:
groupbbb::98001:hisuser
groupccc::98003:
...
outputfile
...
groupaaa::98000:
groupbbb::98001:hisuser,myuser
groupccc::98003:
... The function should check if user is aleady part of the local group and exit
Should I use sed or nawk or something else. Anyone have a nice oneliner :-)
In linux there is gpasswd but i havent found a corresponding command in Solaris. The user are not local on the system but NIS users so usermod will not work I think!
Greatful for any pointers!
/Smedis