Linda Walsh wrote > > Andreas Schwab wrote: > > Linda Walsh <b...@tlinx.org> 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. > --- > Why?
Because that's what the input command expects: your HERE-string *when it reads its standard input* (fd 0) You could implement it with pipes, but as you would need a thread to write the partially-read string, just using a file is simpler. And as you can write it into a deleted file, the effect on storage should be minimal. You should however be able to translate “foo <<<SOMETHING” into “echo SOMETHING | foo” 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 write the non-here version: > declare -p "$var" | read out > get_net_IFnames_hwaddrs | while ... Regards