0
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
Hi!
Many thanks, will check this out asap!
/Smedis – user40797 – 2010-06-23T10:45:08.513
sed -i will edit a file in place. – kmarsh – 2010-06-23T13:09:29.167
@kmarsh: It's not available on Solaris. – Paused until further notice. – 2010-06-23T14:07:11.570
OK, but if he is using Bash, chances are good that he has the rest of the Gnu tools installed. – kmarsh – 2010-06-23T16:50:51.367
I have Gnu tools installed :-) I'm had to switch to another projct but I'will report back! /Smedis – user40797 – 2010-06-24T13:00:19.663