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

Re: newgrp



David Chamont wrote:
> Hi,
> 
> I am working in a cluster of HP Unix workstations.
> We make a big use of Unix groups, and the lack of the
> newgrp command is a real obstacle.
> 
> The FAQ trick does not work (alias newgrp="exec newgrp"),
> perhaps because I put zsh as my login shell.

I don't quite understand the problem.  Are you saying you need the new
shell to be a login shell if the old one was?  You could try something
like this:

newgrp () {
  local args;
  [[ -o login ]] && args=-
  exec =newgrp $args $*
}

If that's what you want I'll change the FAQ.

(Just in case it helps:  if you have changed $SHELL, it looks like
newgrp won't honour it, it will go back to the passwd entry.)

Bonne chance.
-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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