You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that pash depends on bash, as opposed to pash, which only supports POSIX syntax. This is because pash relies on the bashism's export -f. (Am I corerct?)
The default behavior of bash differs slightly from POSIX sh. The following code produces different output on pa.sh.
#!/bin/shset -e
output=$(false;echo"should not be output")echo"$output"
On Ubuntu /bin/sh is dash (POSIX sh).
$ ./test.sh(no output)
$ pa.sh ./test.shshould not be output
This problem can be corrected by running shopt -s inherit_errexit or set -o posix.
However, if executed in a different shell than the expected shell incompatibilities between shells can be problematic. For example, the following code also returns different results. Both of these behaviors are POSIX-compliant and cannot be fixed by set -o posix.
#!/bin/shecho"[\t]"
$ ./test.sh[ ]
$ pa.sh ./test.sh[\t]
The text was updated successfully, but these errors were encountered:
You are correct, PaSh executes everything on top of bash, and aims for compatibility with bash. Furthermore, we have only tested compatibility with bash without the set -o posix.
I noticed that pash depends on bash, as opposed to pash, which only supports POSIX syntax. This is because pash relies on the bashism's
export -f
. (Am I corerct?)The default behavior of bash differs slightly from POSIX sh. The following code produces different output on
pa.sh
.On Ubuntu
/bin/sh
is dash (POSIX sh).This problem can be corrected by running
shopt -s inherit_errexit
orset -o posix
.However, if executed in a different shell than the expected shell incompatibilities between shells can be problematic. For example, the following code also returns different results. Both of these behaviors are POSIX-compliant and cannot be fixed by
set -o posix
.The text was updated successfully, but these errors were encountered: