I am trying to add in my script an awk statement or a:if; else; then if eth0:4 is a match then put in eth0:4 IPHow would you get the IP in your script as a variable if you have multiple IP's assgined to one NIC?inet 133.16.8.9/16 brd 133.8.255.255 scope global eth0inet 133.8.5.8/16 brd 133.8.255.255 scope global secondary eth0:1inet 133.8.5.7/16 brd 133.8.255.255 scope global secondary eth0:2inet 133.8.5.6/16 brd 133.8.255.255 scope global secondary eth0:3inet 133.8.5/16 brd 133.8.255.255 scope global secondary eth0:4inet 133.8.5.4/16 brd 133.8.255.255 scope global secondary eth0:5inet 133.8.5.3/16 brd 133.8.255.255 scope global secondary eth0:6inet 133.8.5.2/16 brd 133.8.255.255 scope global secondary eth0:7
How to scrape multiple IP's and add in a script as a variable?
bash;text processing;sed;awk;scripting