Greg Wooledge wrote:
netdev_pat=... # (and other variable assignments) (cd "$sysnet" && for ifname in ...; do hwaddr=$(<"$ifname"/address) act_hw2if[$hwaddr]="$ifname" act_if2hw[$ifname]="$hwaddr" done)
Except that either act_hw2if + pair were just assigned to in the sub process that was meant to isolate the change of directory from the rest of the program, OR we aren't in the right directory when we do the reads. Either way, they code as you have suggested won't work without overcoming another set of side effects.