Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2003 01:47:19 GMT
From:      abc@anchorageinternet.org
To:        "freebsd-questions" <questions@freebsd.org>
Subject:   Re: #!/bin/sh & execve
Message-ID:  <200302100147.h1A1lJoZ022354@en26.groggy.anc.acsalaska.net>

next in thread | raw e-mail | index | archive | help
minor correction/addition to previous post:

instead of "infinitely recursive", i should've
said that it would break things if "script"
re-exec's the same file with a
different interpreter.

--

> 	#!/bin/sh
> 	. script

this won't work if "script" is going to do something
before exec'ing the file itself.  it will end up
being infinitely recursive.  and similarly for
the following:

> > #!/bin/sh -n script     this is currently not ok
>                           but why shouldn't it be?
> 	#!/bin/sh
> 	exec /bin/sh -n script
>
> > #!/bin/sh script 1 2    this is ok with FBSD and RH Linux,
> >                         but not ok in a few implementations,
> >                         but why shouldn't it be?
>
> 	#!/bin/sh
> 	exec /bin/sh script 1 2

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




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