Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Angel
Greg Wooledge wrote: > The 'read' example will not work as you've written it. The change to > the shell variable 'out' will be lost when the pipeline terminates. > (But you can get a very recent bash release and set the "lastpipe" > shopt to work around this.) > > If the while loop also tries to

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Linda Walsh
Greg Wooledge wrote: read out < <(declare -p "$var") That code actually isn't called. It's used by "isarray" to tell me whether or not a var is an array. The code that doesn't work is the line with the comment "line 233". (which is now line 235 from the latest error message. service boo

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Greg Wooledge
On Tue, Jul 29, 2014 at 10:21:36PM +0200, Angel wrote: > What surprises me is that the only use of here-docs (actually > here-strings) in your script are process substitutions: > > read out <<<$(declare -p "$var" ) > > while ... done <<<"$(get_net_IFnames_hwaddrs)" > > When it looks simpler to wri

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Angel
Linda Walsh wrote > > Andreas Schwab wrote: > > Linda Walsh writes: > > > >>Except that in-line HERE docs don't need to be implemented > >> through a tmp file unless you want to slow things down. > >>They should be read out of memory and NOT transfered to > >> to non-existent, external s

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Greg Wooledge
On Tue, Jul 29, 2014 at 12:06:41PM -0700, Linda Walsh wrote: > Andreas Schwab wrote: > >You need a file descriptor for your memory storage. > --- > Why? A here-document is a redirection. All it does it change where stdin comes from. There has to be a place for file descriptor 0 to point to. This

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Linda Walsh
Andreas Schwab wrote: Linda Walsh writes: Except that in-line HERE docs don't need to be implemented through a tmp file unless you want to slow things down. They should be read out of memory and NOT transfered to to non-existent, external storage. You need a file descriptor

Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory"

2014-07-29 Thread Andreas Schwab
Linda Walsh writes: > Except that in-line HERE docs don't need to be implemented > through a tmp file unless you want to slow things down. > They should be read out of memory and NOT transfered to > to non-existent, external storage. You need a file descriptor for your memory storage