On Mon, Jun 11, 2012 at 4:24 PM, David Korn <[email protected]> wrote: >> Is there a reason why the newgrp builtin and /usr/bin/newgrp behave >> differently on Solaris? /usr/bin/newgrp and newgrp both switch to the >> specified group to execute commands, but if something goes wrong, like >> specifying newgrp --help, the builtin newgrp will terminate the >> calling shell (in case of a login shell this means you're being logged >> out) while /usr/bin/newgrp leaves the calling shell running. > > newgrp in ksh is equivalent to exec newgrp. This behavior is permitted > by the posix standard and was the behavior in the Bourne shell. > I might revisit this for ksh93v.
Erm... note: You still have to call the external /usr/bin/newgrp because it must be a setuid "root" binary to handle groups which are normally not part of the users Unix credentials but are accessible using group passwords (such password-protected groups are often used on universities). AFAIK it might be sufficient to execute it like a normal shell command and not |exec()| it to replace the current shell process. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [email protected] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
