replacing parts of a line in a file (/etc/group).
If I have the following line in my group file, I want to remove all of the "sdb" entries, but leave anything else. For instance:
sdba::1014:sdb,sdb,david,sdb
would need to be changed to:
sdba::1014:david
I'm trying to do this with perl -pi -e if I can. This SORT of gets me there, but removes the "david" entry.
egrep "^sdba:" $TEMP && perl -pi -e "s/^sdba::.*/sdba::1014:/g" $TEMP
Thanks!
David