The following script use eval with 3 pipes, 1st time with direct pipe on
the command line, and the 2nd time with a pipe in a variable.
In this second eval, the PIPESTATUS does not content 3 entries, but only 2.

cat <<'EOF' > eval_pipe.sh
#!/bin/env bash
set -u

eval echo 'titi' | grep toto | grep titi
ret_codes=(${PIPESTATUS[*]})
echo ret_codes=${ret_codes[*]}
aPipe='|'
eval echo 'titi' $aPipe grep toto | grep titi
ret_codes=(${PIPESTATUS[*]})
echo ret_codes=${ret_codes[*]}
EOF
chmod +x eval_pipe.sh
eval_pipe.sh
<<<<<<<<<<
ret_codes=0 1 1
ret_codes=1 1
>>>>>>>>>>

Could be reproduce with bash version 2.05b (all patch applied) on Tru64
Unix 5.1A, version 2.05b.0(1)-release on cygwin, ...




_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to