Data piped to 'mapfile', 'readarray', 'read -a' shell builtins is ignored

2010-03-24 Thread Rob Robason
Configuration: OS: Fedora 11 - with all updates applied Bash: version 4.0.23(1)-release Problem description: When stdin is a pipeline to 'mapfile', 'readarray', and 'read -a' shell built-in commands, they fail to assign any values to the target array. The array is neither unset nor altere

Re: Data piped to 'mapfile', 'readarray', 'read -a' shell builtins is ignored

2010-03-24 Thread Pierre Gaston
On Wed, Mar 24, 2010 at 12:43 AM, Rob Robason wrote: > Configuration: >OS: Fedora 11 - with all updates applied >Bash: version 4.0.23(1)-release > > Problem description: > When stdin is a pipeline to 'mapfile', 'readarray', and 'read -a' shell > built-in commands, they fail to assign any

Re: Data piped to 'mapfile', 'readarray', 'read -a' shell builtins is ignored

2010-03-24 Thread Greg Wooledge
On Wed, Mar 24, 2010 at 04:10:41PM +0200, Pierre Gaston wrote: > On Wed, Mar 24, 2010 at 12:43 AM, Rob Robason wrote: > >$ ls -a | readarray# using the default MAPFILE array > It's a faq, commands in a pipe are executed in a subshell and don't modify > the parent shell. And the wo