My file contain:
Code:
shopt -s lastpipe
exit 142 | false
echo $? -- ${PIPESTATUS[@]}
I run command: /bin/bash myfile
It output:
Code:
Hangup | false
129 -- 142 129
The correct should:
When I run the above line by line in shell, it was correct.
why run it on a file, it failed?