What you said it does, in case that's what you want:
perl -ne'print "$.\t$_" if /GRHL3/'
What it actually does (only the second field is checked for the pattern):
perl -ane'print "$.\t$_" if $F[1] =~ /GRHL3/'
$. is in perlvar, and -n and -a are in perlrun.
In reply to Re: print if // line number?
by ikegami
in thread print if // line number?
by ZWcarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |