In /etc/group file I need to append usernames at the end of a group
record so that these users will also belong to that group.
in /etc/group file
if the records r like
I need to find the line where group2 is present and append usernames like
group2:x:103:user1 user2 user3
so that these users also belong to group2
g/^group2:/s/$/user1 user2 user3/
Of course, backup /etc/group.
However, I vaguely recall there is a group maintenance command -which is the correct way of doing this.
usermod -G <group to add> <user login>
Do you have a UNIX Question?
Unix Home: Unix System Administration
Hints and Tips