perl - Using one grep operation instead of two? -
is there efficient way use grep in following command running, since want use perl's grep?
@found = grep { !/$ip/ } `$ssh $ips[0] netstat -aan | /bin/grep 1010`; basically, connecting fileserver, executing netstat command , grep ip addresses containing 1010. on output need use grep find specific ip address. can done somehow using 1 perl command?
sure, can this:
@found = grep { /1010/ && !/$ip/ } `$ssh $ips[0] netstat -aan`; the condition use in grep can not arbitrary expression, full block of code if need be.
Comments
Post a Comment