Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.2
Patch Level: 15
Release Status: release
Description: In the following script,
#!/bin/bash
true && {
echo here 1
test "$PIPESTATUS" "!=" "0"
#echo here 2
} || {
echo here 3
}
The output is:
here 1
here 3 ("here 3" should never be output, I think, because of the grouping)
If "#echo here 2" is uncommented the output is
here 1
here 2 (which is what I would expect)
Another way to get the correct behavior is to change "$PIPESTATUS" to,
e.g. "$PATH". Then the output is:
here 1
#!/bin/bash
true && {
echo here 1
test "$PIPESTATUS" "!=" "0"
#echo here 2
} || {
echo here 3
}