I have a variable like
master='172.21.154.37 172.21.250.94 172.21.251.93 172.21.250.94' and I need to check whether the first and the second column in the file both matches the variable. The following is an example, the second line, 172.21.154.37 can be found in variables $master and 172.21.250.94 can also found in $master
172.21.154.40 172.21.254.25
172.21.154.37 172.21.250.94
172.21.250.93 172.21.254.24
awk '$1 /'$master'/ {print $0 }' /tmp/newip.txt but there is an escapte issue awk '$1 /172.21.154.37' 172.21.250.94 172.21.251.93 '172.21.250.94/ {print $0 }' /tmp/newip.txt
issue resolved,tks