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


Groups > gnu.bash.bug > #15445 > unrolled thread

Re: shebang-less script execution not resetting some options

Started byChet Ramey <chet.ramey@case.edu>
First post2019-10-01 10:16 -0400
Last post2019-10-01 10:16 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#15445 — Re: shebang-less script execution not resetting some options

FromChet Ramey <chet.ramey@case.edu>
Date2019-10-01 10:16 -0400
SubjectRe: shebang-less script execution not resetting some options
Message-ID<mailman.600.1569939415.2651.bug-bash@gnu.org>
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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web