jhwilliams |
01-24-2012 07:53 AM |
Quote:
Originally Posted by the_gripmaster
(Post 4582996)
Why is sed so cryptic?
|
I remember feeling that way, too. Here, this is a /little/ clearer, with extended regex:
Code:
sed -r 's/(wheel:.*)/\1,user3/' /etc/group
Regex is a powerful tool - it's a trade off between ease of use and capability of expression. I think if we tried to create such a regular expression language of our own it might end up being just as ugly, if only different.
Incidentally, if I am correctly guessing what you're trying to do, you might find it easier to just add the group membership to the user's list with this command:
Code:
sudo usermod -a -G wheel user3
|