Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Feb 1999 23:54:24 -0500 (EST)
From:      Mikhail Teterin <mi@kot.ne.mediaone.net>
To:        current@freebsd.org
Subject:   Re: sh(1) -- exec vs. fork
Message-ID:  <199902220454.XAA19404@kot.ne.mediaone.net>
In-Reply-To: <199902200258.AA26119@waltz.rahul.net> from Rahul Dhesi at "Feb 19, 1999 06:58:32 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
So, should I send-pr?

	-mi

Rahul Dhesi once stated:

=Many years ago I posted a shell script to Usenet in which I prepended a
=line with 'exec', in an attempt to avoid having a shell process hanging
=around doing a wait().  David Korn himself (of Korn shell fame)
=responded saying this was not necessary, as the shell would do exec()
=anyway.
=
=I check with trace() on a Sun and he seemed to be right.  This was for
=the classic Bourne shell many years ago.
=
=But I just checked /bin/sh on 3.1-RELEASE with ktrace and the above does
=not seem to be true.  I get drastically different traces for
=
=   #! /bin/sh
=   exec /bin/pwd
=
=and
=
=   #! /bin/sh
=   /bin/pwd
=
=Rahul
=
=> Date:  Fri, 19 Feb 99 11:43:59 EST
=> From:  Mikhail Teterin <mi@misha.cisco.com>
=> To:    current@freebsd.org
=> Message-Id: <199902191644.LAA08791@misha.cisco.com>
=> Subject: sh(1) -- exec vs. fork
=> Reply-To: mi@aldan.algebra.com
=
=> I just finished going through a couple of crontabs prepending the
=> command-lines with ``exec'', when it hit me.
=> 
=> Can shell itself recognize, there will be no more commands and just
=> proceed to exec without forking? What would this break?
=...
=
=
=To Unsubscribe: send mail to majordomo@FreeBSD.org
=with "unsubscribe freebsd-current" in the body of the message
=



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902220454.XAA19404>