Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a bash script actually, not a (implied POSIX) shell script. Do not mix these two.


> (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?


Seems 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.


I 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?


It 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.


both bash and zsh are orders of magnitude more complex than sh or even ksh


Bash is a shell script. Posix is not implied.


This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: