the following perl one liner syntax verify if IP address in $IP match the IP ADDRESS in file     perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' $IP filefile have two fieldsas the following examplemore file192.9.200.1  172.19.2.10010.23.1.10   34.12.0.145.2.11.1    192.9.200.1...is it possible to define the perl syntax to match the IP that exists in the first field or the second field ? - if yes what I need to change in my syntax for that? for example ( in case we want to match only the first field )     perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' 192.9.200.1 filethen it should to match the IP - 192.9.200.1 that exists in the first field of the line:   192.9.200.1  172.19.2.100
perl one liner + how to match IP address that located in the first/sec field of file
linux;shell script;solaris;perl;ksh