Created
September 27, 2015 17:30
-
-
Save Ovsyanka/917f63f2f72230c2ac7b to your computer and use it in GitHub Desktop.
Take assigning to group without relogin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# it can not be executed as script because newgrp starting a new shell | |
# src: http://superuser.com/questions/272061/reload-a-linux-users-group-assignments-without-logging-out/345051#345051 | |
newGrpName=<grpName> | |
currentGrpId=`id -g` | |
exec newgrp $newGrpName | |
exec newgrp #$currentGrpId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment