zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: aismtnt@tutanota.com
Cc: zsh-workers@zsh.org
Subject: Re: Command execution
Date: Mon, 15 Nov 2021 14:33:28 +0100	[thread overview]
Message-ID: <CAHYJk3TWn1+SrBSNyaZypPfyeU7qmFm-XUF-5+m=ksP2Ni9=dQ@mail.gmail.com> (raw)
In-Reply-To: <MoYOZpg--3-2@tutanota.com>

On 11/15/21, aismtnt@tutanota.com <aismtnt@tutanota.com> 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


  reply	other threads:[~2021-11-15 13:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 11:40 aismtnt
2021-11-15 13:33 ` Mikael Magnusson [this message]
2021-11-15 13:39   ` Roman Perepelitsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3TWn1+SrBSNyaZypPfyeU7qmFm-XUF-5+m=ksP2Ni9=dQ@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=aismtnt@tutanota.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).