Try this in a script, variable can be parsed further on:
ip addr | grep inet | grep 10.42 | tail -1 | awk ‘{print $2}’ | awk -F/ ‘{print $1}’
1 Like
Try this in a script, variable can be parsed further on:
ip addr | grep inet | grep 10.42 | tail -1 | awk ‘{print $2}’ | awk -F/ ‘{print $1}’