- try this on your bash shell:
- `ONEVAR="testing" eval 'bash -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value' '| grep value' ; echo ${PIPESTATUS[*]}`
- Notice how PIPESTATUS has only one element. and it is always true, although we failed explicitly with false in the middle of the bash.
- That is because eval itself is considered a single command, no matter how many pipes you put in there, you'll get a single value, the return code of the LAST pipe.
- Lets export the value of the pipe inside eval so we know outside what happened:
- `ONEVAR="testing" eval 'bash -e -c "echo value once $ONEVAR && false && echo value twice $ONEVAR"' '| grep value' '| grep value' ';EVALPIPE=(${PIPESTATUS[@]})' ; echo ${EVALPIPE[*]}`
- also: pass LC_ALL=C LANG=C to avoid locale warnings
Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
|
||
|---|---|---|
| .. | ||
| build-all-ng.sh | ||
| chroot-buildpackages.sh | ||
| compilation-prepare.sh | ||
| compilation.sh | ||
| configuration.sh | ||
| debootstrap.sh | ||
| desktop.sh | ||
| distributions.sh | ||
| fel-load.sh | ||
| general.sh | ||
| image-helpers.sh | ||
| main.sh | ||
| makeboarddeb.sh | ||