So I have this:
INTERFACES=($(ip -o link show | awk -F': ' '{print $2}'))
Giving me an array of interfaces, however I want to remove the loopback and tun adapters from the array.
INTERFACES=(${INTERFACES[@]/lo/})
INTERFACES=(${INTERFACES[@]/tun*/})
Works, but is there a way to do this in a single line?
Probably super easy and derp, but I'd like to understand how the expression actually works (google gave me 47239432 examples of the above but not one explained how it worked or gave an example of using more than one expression at a time).
I know this can be done with the awk command, so both a solution with awk and one with the array filter would be appreciated greatly :)
My apologies if this is a stupid question.