Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Setting default group (newgrp ?)



On Tue, 6 Jan 2009, Webb Sprague wrote:

How do I set my default group, so that when I create a file it gets the new group ownership?

I get all sorts of weird results when I try newgrp foogroup....

newgrp foogroup works for me.

$ zsh --version
zsh 4.3.6 (i686-pc-linux-gnu)


I often find bizarre results when I've added myself to a group but haven't yet rebooted. IIRC, one workaround is to restart nscd. Another is to log in as yourself, but that only works in the shell you log into (already-opened shells don't catch the change).

I have two alii(/aliases) set for this purpose:

alias z=' exec zsh'
alias Z=' exec sudo su bhaskell -'

They're mostly for testing Zsh startup script changes. But, the latter one handles this particular problem. (adding myself to a group without restarting.) The leading space prevents these from showing up in history. The 'exec' prevents having to Ctrl+D twice to exit.

Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author