in reply to What is the simplest way to print a field, as in $3 does in awk

cat /etc/hosts | perl -ne 'print if (split(/\s+/,$_))[1] =~ localhost'
  • Comment on Re: What is the simplest way to print a field, as in $3 does in awk
  • Download Code