Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15445

Re: shebang-less script execution not resetting some options

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: shebang-less script execution not resetting some options
Date 2019-10-01 10:16 -0400
Message-ID <mailman.600.1569939415.2651.bug-bash@gnu.org> (permalink)
References <CAMu=BrpjDvF9Rz=JFaGoxV5AwjRoq=aC1htaybVz_kPFsDinbA@mail.gmail.com> <5D9334F8.3090503@tlinx.org> <2d5e4e29-2a88-9d7e-76a8-67a66d56b483@case.edu>

Show all headers | View raw


On 10/1/19 7:14 AM, L A Walsh wrote:
> On 2019/09/30 14:39, Grisha Levit wrote:
>> A few of the recently-added shopt options aren't getting reset when
>> running a shebang-less script, this should fix it up:
>>   
> Suppose the shebang-less script is being run by an earlier version
> of bash.  Won't the new patch radically change the behavior of of
> such programs?

No.

> Does posix define the behavior of a child script with no interp-line?

"If the execl() function fails due to an error equivalent to the [ENOEXEC]
error defined in the System Interfaces volume of POSIX.1-2017, the shell
shall execute a command equivalent to having a shell invoked with the
pathname resulting from the search as its first operand, with any remaining
arguments passed to the new shell, except that the value of "$0" in the new
shell may be set to the command name."

POSIX doesn't define any executable formats, including #!.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: shebang-less script execution not resetting some options Chet Ramey <chet.ramey@case.edu> - 2019-10-01 10:16 -0400

csiph-web