Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Command execution
- X-seq: zsh-workers 49588
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: aismtnt@xxxxxxxxxxxx
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Command execution
- Date: Mon, 15 Nov 2021 14:33:28 +0100
- Archived-at: <https://zsh.org/workers/49588>
- In-reply-to: <MoYOZpg--3-2@tutanota.com>
- List-id: <zsh-workers.zsh.org>
- References: <MoYOZpg--3-2@tutanota.com>
On 11/15/21, aismtnt@xxxxxxxxxxxx <aismtnt@xxxxxxxxxxxx> wrote:
>
> Documentation:
> https://zsh.sourceforge.io/Doc/Release/Command-Execution.html
>
> There is a statement in docs:
>
> 'If execution fails because the file is not in executable format,and the
> file is not a directory, it is assumed to be a shellscript. /bin/sh is
> spawned to execute it.'
>
> I wonder if it's true or maybe I'm missing something.
>
> My understanding is that if I create a file with shell commands but won't
> change its mode to executable, it will still be executed, because it is
> assumed to be a shell script.
>
> But it does not.
"executable format" refers to the contents of the file, eg will the
kernel exec()ute this, and "executable mode" refers to the mode of the
file, they are not the same thing. The quoted statement only applies
if execution failed because of the file contents not being a valid
executable format, but in your case the execution failed because of
missing permissions (earlier check), so the statement does not apply.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author