On Wed, Apr 25, 2012 at 04:05:15PM -0400, Chet Ramey wrote: > OK. Now make the call move_to_high_fd(0, 1, -1) and see if that fixes it.
cyclops:/var/tmp/bash/bash-4.2$ ./bash ~/foo <hi> cyclops:/var/tmp/bash/bash-4.2$ ./bash -c 'shopt -s lastpipe; echo hi | read foo; echo "<$foo>"' <hi> cyclops:/var/tmp/bash/bash-4.2$ ./bash < ~/foo <hi> So those three cases work. I tried one other test for grins (remember that ulimit -n is 128): cyclops:/var/tmp/bash/bash-4.2$ ./bash -c 'shopt -s lastpipe; exec 3</dev/null 4</dev/null 5</dev/null 125</dev/null 126</dev/null; echo hi | read foo; echo "<$foo>"' <hi> Looks good at first glance.