3
votes
2answers
94 views

how to initialize `/etc/group`?

After editing /etc/group, How this update starts functioning without restarting the system in Unix? Is there any command we need to run?
5
votes
1answer
137 views

Can I add to my groups in the current (shell) process? [duplicate]

If I add myself to a group, it applies only to newly launched processes. Actually it's more restricted than that; it seems to apply only to new logins. I'm not sure what the exact mechanism is, but ...
2
votes
1answer
193 views

Why does newgrp change my PS1 and how to prevent it?

I have a customized PS1 to show several parameters. When I switch to a different group using newgrp, it switched my PS1 to default ($) and that is annoying. The default remains even when I switch ...
3
votes
3answers
431 views

Escaping argument in bash script?

I'm writing a bash script wherein I want to check that one of the arguments passed to it is a valid group. I have the line if [ `grep -c -e '\b$2\b' /etc/group` -eq 0 ]; then echo "Error: $2 is ...