[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file
From: |
Angel |
Subject: |
Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory" |
Date: |
Tue, 29 Jul 2014 22:21:36 +0200 |
Linda Walsh wrote
>
> Andreas Schwab wrote:
> > Linda Walsh <bash@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
- Re: HERE document failed && Re: /dev/fd/62: No such file or directory, Linda Walsh, 2014/07/24
- Re: HERE document failed && Re: /dev/fd/62: No such file or directory, Chet Ramey, 2014/07/25
- Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/25
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Greg Wooledge, 2014/07/28
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/28
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Andreas Schwab, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Greg Wooledge, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory",
Angel <=
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Greg Wooledge, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Angel, 2014/07/29
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/30
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Chet Ramey, 2014/07/31
- Re: Code for :"Re: HERE document failed && Re: /dev/fd/62: No such file or directory", Linda Walsh, 2014/07/31