On 10/6/14, 3:14 PM, Linda Walsh wrote:
> In running a startup script, I am endeavoring not to use tmp files
> where possible, As part of this, I sent the output of a command
> to stdout where I read it using the "variable read" syntax:
>
> while read ifname hwaddr; do
> printf "ifname=%s, hwaddr=%s\n" "$ifname" "$hwaddr"
> act_hw2if[$hwaddr]="$ifname"
> act_if2hw[$ifname]="$hwaddr"
> printf "act_hw2if[%s]=%s, act_if2hw[%s]=%s\n"
> "${act_hw2if[$hwaddr]}" "${act_if2hw[$ifname]}"
> done <<<"$(get_net_IFnames_hwaddrs)"
>
> Note, I used the <<<"$()" form to avoid process substitution -- as I was told
> on this list that the <<< form didn't use process substitution.
Correct, it does not.
>
> So I now get:
>> >>/etc/init.d/boot.assign_netif_names#192(get_net_IFnames_hwaddrs)>
> echo eth5 a0:36:9f:15:c9:c2
> /etc/init.d/boot.assign_netif_names: line 203: cannot create temp file for
> here-document: No such file or directory
>
> Where am I using a HERE doc?
You're using a here-string, which is a variant of a here-document. They
differ very little, mostly in syntax. The internal implementation is
identical.
> More importantly, at this point, where is it trying to write?/(Read).
>
> Simple Q. Why isn't it using some small fraction of the 90+G of memory
> that is free for use at this point?
Because the shell uses temp files for this. It's a simple, general
solution to the problem of providing arbitrary data on stdin.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/