Re: Bad file descriptor with coproc and pipe

2014-02-06 Thread Chet Ramey
On 2/5/14 4:37 PM, Michal Sojka wrote: >> Bash closes file descriptors associated with coprocs in child processes, >> since they are pipes. It's even more careful when those child processes >> are part of pipelines. It's really a bad idea to have pipe file >> descriptors open in multiple process

Re: Bad file descriptor with coproc and pipe

2014-02-05 Thread Michal Sojka
On Wed, Feb 05 2014, Chet Ramey wrote: > On 2/4/14, 2:34 AM, Michal Sojka wrote: > >> Bash Version: 4.2 >> Patch Level: 45 >> Release Status: release >> >> Description: >> The following commands fail: >> >> coproc while true; do echo $RANDOM; done >> cat <&${COPROC[0]} | ca

Re: Bad file descriptor with coproc and pipe

2014-02-04 Thread Chet Ramey
On 2/4/14, 2:34 AM, Michal Sojka wrote: > Bash Version: 4.2 > Patch Level: 45 > Release Status: release > > Description: > The following commands fail: > > coproc while true; do echo $RANDOM; done > cat <&${COPROC[0]} | cat > > The resulting error message is: >

Bad file descriptor with coproc and pipe

2014-02-04 Thread Michal Sojka
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKA