trying to grep for a string at a certain position in a commands output in order to use it as a variable:
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.2.1 0.0.0.0 UG 0 0 0 wlan1
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan1
I want grep to pull out from the 'route' function, the network interface being used, always in that position, I just don't know how to specify the position, ideally to work regardless of the name, be it wlan0/1 or eth0 etc.
Many thanks.