3 ms·
As a bash script actually, not a (implied POSIX) shell script. Do not mix these two.
by arisudesu 2y ago
As a bash script actually, not a (implied POSIX) shell script. Do not mix these two.
- bananskalhalk 2y agoSeems to work in zsh too. Both bash and zsh are shells like c-shell ksh etc. Nowhere is it implied that shell-scripts are written for Bourne shell.
- sambazi 2y agoboth bash and zsh are orders of magnitude more complex than sh or even ksh
- arisudesu 2y agoI am not familiar with zsh, but is it really interpreted by zsh? Because the script has #!/usr/bin/env bash in its shebang, isn't it executed by bash on your system, even if launched from zsh?
- bananskalhalk 2y agoIt seems to be very source-able in both bash and zsh. If you just executed it, it will run in bash. They seem to have gone through some effort for this to be true.
- keybored 2y agoBash is a shell script. Posix is not implied.
- arisudesu 2y agoThis script is explicitly a Bash script and it is not executable by every other shell present on modern unix-like systems. Examples are Korn shell, Almquist shell. Hence the distinction: if one states that the script is a shell-script, it implies that it can be interpreted by any modern shell, for which there is only one common denominator, POSIX. This script is explicitly only Bash shell compatible, not any-shell compatible.
- yau8edq12i 2y ago> (implied POSIX) shell script Why would POSIX be implied in any way? I mainly use windows, should I have been upset because I thought cmd or powershell was implied?