Sometimes you want to find files with tabs (\t) within their content. With most greps this is a difficult task:
$ bash $ TAB=$(printf "\t") $ grep -Hn "$TAB" *
Using perl, there is another problem: If you want to see the line number, you usually use the special $. variable. But:
Because <> never does an explicit close, line numbers increase across ARGV files.
So you have to close ARGV manually:
$ perl -lne 'print "$ARGV:$.:$_" if /\t/ } continue { close ARGV if eo +f } {' *
-- Frank
In reply to Searching tabs in a list of files by haoess
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |