You just added a user to your UNIX system. You want him to belong to all groups where you belong. E.g.: let's say your user name is bronto and the new user is robin. Here we go.
perl -F: -i.save -ape 'if ($F[3] =~ m{bronto} and not m{robin}) { chom +p ; $_ .= qq{,robin\n} }' /etc/group
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Adding a new user to all groups where another user is
by Limbic~Region (Chancellor) on May 12, 2008 at 17:59 UTC | |
by bronto (Priest) on May 17, 2008 at 12:56 UTC |
Back to
Cool Uses for Perl