I have an array that contains details about each NIC. Each array index consists of three space-separated values.
I would like to have a nice table as output. Is there a way to assign formatting patterns to each value in an index?
so far this is what I use:
NIC_details[0]='wlp2s0 192.168.1.221 xx:xx:xx:xx:xx:xx'
NIC_details[1]='wwan0 none xx:xx:xx:xx:xx:xx'
NIC_details[2]='virbr0 192.168.122.1 00:00:00:00:00:00'
printf "%-20s\n" "${NIC_details[@]}"
Is there a way to access the values in an array index by their position $1, $2, and $3, knowing that they are space-separated, and then apply a formatting pattern for each $X position?
I have also tried
echo "$i" | column -t
but it does not bring the desired result.