3 ms·
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 d
by chasil 4y ago
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.
- paskozdilar 4y agoAliases seem to work on Bash 5.0.17: #!/bin/sh alias p=printf p ok
- jwilk 4y agoTry with #!/bin/bash shebang.
- paskozdilar 4y agoAh, I misread the post. My bad.
- deleted 4y ago[deleted]