Re: Shell from inside Emacs

Jean Louis <[email protected]>
Newsgroups gmane.emacs.help
Organization GNU Support
Message-ID <[email protected]>
On 2026-04-07 10:42, Andreas Röhler wrote:
> Hi,
> 
> at Linux, did
> 
> sudo usermod -aG MY_NEW_GROUP "$USER"
> newgrp MY_NEW_GROUP
> 
> Works fine from a new xterm.
> 
> But shell inside Emacs seems to read the environment only from start.
> MY_NEW_GROUP is shown by ‘groups’ command only after restart of Emacs.

Instead of newgrp, use sg to run specific commands with the new group:

sg MY_NEW_GROUP -c "your_command_here"

Or start a new shell with the group:

sg MY_NEW_GROUP -c "$SHELL"

or

exec newgrp MY_NEW_GROUP

This replaces the current shell process. Works in M-x shell but will 
exit the shell when done.

-- 
Jean Louis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.