Skip to content

Instantly share code, notes, and snippets.

@Ovsyanka
Created September 27, 2015 17:30
Show Gist options
  • Save Ovsyanka/917f63f2f72230c2ac7b to your computer and use it in GitHub Desktop.
Save Ovsyanka/917f63f2f72230c2ac7b to your computer and use it in GitHub Desktop.
Take assigning to group without relogin
#!/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