I'd like to split a string with BusyBox's awk
using multiple and different characters. For example, spaces and slashes.
I read the answer of Can field separator in awk encompass multiple characters?. It states that you should be able to pass "even a regex" as separator. But I'm unable to find the right syntax:
It is this output line of ip
which I'm working on:
inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
I'd like to exact the IPv4 address:
ip -4 addr show dev eth0 | grep inet | awk -F'[ \/]' '{print $2;}'
But it doesn't work.