Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Command execution




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 shell script. /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.

```zsh
# Create file.
echo 'echo "Hello world"' > my_script

# Run file.
my_script
zsh: command not found: my_script
```


Messages sorted by: Reverse Date, Date, Thread, Author