I am trying to run commands based on the output of a previous command:
ifaces=$(ls /sys/class/net)
for i in "${ifaces[@]}"
do
mac=$(cat /sys/class/net/$i/address)
echo "$i: $mac"
done
but its not working, i'm not sure if my method of concatenation is wrong?