rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: More stuff related to exec...
@ 1992-12-04  2:38 Tom Culliton x2278
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Culliton x2278 @ 1992-12-04  2:38 UTC (permalink / raw)
  To: noel; +Cc: rc

> che? what happened to berkeley multi-groups?

Can you say SysVr3?  I knew you could!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: More stuff related to exec...
@ 1992-12-04 14:52 Chet Ramey
  0 siblings, 0 replies; 5+ messages in thread
From: Chet Ramey @ 1992-12-04 14:52 UTC (permalink / raw)
  To: culliton; +Cc: rc, chet

> Here, presented for your amusement, is a cute little stunt that sh,
> ksh, and csh do and that rc, and bash do not.
> 
> If you have occasion to use the "newgrp" command or read the man page
> it says that when you run newgrp it replaces the current shell
> (effectively an exec) this obviously entails magic within the shells
> (try "strings /bin/sh | grep newgrp")  Not only that, but newgrp seems
> to revert to the shell named in the login file, ignoring the current
> setting of SHELL.

With the advent of BSD-like multiple groups in Posix and most Unix versions,
it's not worth the space it takes to have a `newgrp' shell builtin.

> If you care about the exec behaviour you can obviously create a newgrp
> function ("fn newgrp { exec /bin/newgrp $* }").  As for the other, it
> looks like that's just the way the ball bounces.  Isn't unix fun? ;-)

Shells that have a newgrp builtin just do the exec internally, so a shell
function suffices.  (Look at the tcsh source, for instance.)  That is, if
you care enough about newgrp to want one.

Chet

--
``The use of history as therapy means the corruption of history as history.''
	-- Arthur Schlesinger

Chet Ramey, Case Western Reserve University	Internet: chet@po.CWRU.Edu


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: More stuff related to exec...
  1992-12-03 21:11 ` noel
@ 1992-12-03 23:22   ` David J. Fiander
  0 siblings, 0 replies; 5+ messages in thread
From: David J. Fiander @ 1992-12-03 23:22 UTC (permalink / raw)
  To: noel; +Cc: Tom Culliton x2278, rc

>    If you have occasion to use the "newgrp" command or read the man page
>
>che? what happened to berkeley multi-groups?

Last time I checked, my xenix box isn't running BSD Unix.

- David


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: More stuff related to exec...
  1992-12-03 16:37 Tom Culliton x2278
@ 1992-12-03 21:11 ` noel
  1992-12-03 23:22   ` David J. Fiander
  0 siblings, 1 reply; 5+ messages in thread
From: noel @ 1992-12-03 21:11 UTC (permalink / raw)
  To: Tom Culliton x2278, rc

    From:	culliton@srg.af.mil (Tom Culliton x2278)
    Subject: More stuff related to exec...

    If you have occasion to use the "newgrp" command or read the man page

che? what happened to berkeley multi-groups?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* More stuff related to exec...
@ 1992-12-03 16:37 Tom Culliton x2278
  1992-12-03 21:11 ` noel
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Culliton x2278 @ 1992-12-03 16:37 UTC (permalink / raw)
  To: rc

Here, presented for your amusement, is a cute little stunt that sh,
ksh, and csh do and that rc, and bash do not.

If you have occasion to use the "newgrp" command or read the man page
it says that when you run newgrp it replaces the current shell
(effectively an exec) this obviously entails magic within the shells
(try "strings /bin/sh | grep newgrp")  Not only that, but newgrp seems
to revert to the shell named in the login file, ignoring the current
setting of SHELL.

If you care about the exec behaviour you can obviously create a newgrp
function ("fn newgrp { exec /bin/newgrp $* }").  As for the other, it
looks like that's just the way the ball bounces.  Isn't unix fun? ;-)

Tom


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1992-12-04 15:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-04  2:38 More stuff related to exec Tom Culliton x2278
  -- strict thread matches above, loose matches on Subject: below --
1992-12-04 14:52 Chet Ramey
1992-12-03 16:37 Tom Culliton x2278
1992-12-03 21:11 ` noel
1992-12-03 23:22   ` David J. Fiander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).