[SOLVED] Get list of ips on specific nic
by Prasad321 from LinuxQuestions.org on (#6G0RH)
I am trying to get list of ips in specific nic. I am able to archive using below
ips=$(ip addr | grep ens192 | grep global| awk {'print $2'} | xargs)
10.200.109.141/24
10.200.109.142/24
10.200.109.143/24
I am trying to get only ips not with /24. Please advise.
10.200.109.141
10.200.109.142
10.200.109.143
ips=$(ip addr | grep ens192 | grep global| awk {'print $2'} | xargs)
10.200.109.141/24
10.200.109.142/24
10.200.109.143/24
I am trying to get only ips not with /24. Please advise.
10.200.109.141
10.200.109.142
10.200.109.143