Hacker News new | past | comments | ask | show | jobs | submit login

It kinda almost is though.



With Ubuntu using dash as its /bin/sh and macOS defaulting to zsh for interactive shells (I think their /bin/sh is still bash, but haven’t checked), this is probably the least true now that it’s been for a couple decades.


Also, as noted in another comment: windows has its own shell(s) which are entirely unrelated to bash.


People have said the same thing about sh.

And neither bash nor sh are that great, so no reason to put down the idea that they shouldn't be the "default"


Over the past 10 years it has been losing market share to zsh and to a lesser extent, fish. It's really isn't anymore.


Bash is a chameleon.

When called as /bin/sh or if the POSIXLY_CORRECT environment variable is set, it will act as a POSIX shell.

If not, it will behave very differently. The one major difference that I know is that aliases will be ignored in the execution of a script, so "alias p=printf" will fail (for example). This is not POSIX-compliant.


Aliases seem to work on Bash 5.0.17:

    #!/bin/sh
    alias p=printf
    p ok


Try with #!/bin/bash shebang.


Ah, I misread the post. My bad.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: