in reply to Searching tabs in a list of files
Where "<TAB>" represents a tab character. To type the tab, first hit ctrl-v, then hit TAB -- that should insert an actual tab character. (note it probably won't copy/paste correctly, so be careful if you're copying the grep command from a notes file or something)grep -Hn '<TAB>' *
cat -nT /tmp/foo | grep '\^I'
Identical to yours except i believe that the ... } continue { ... } { construct is unnecessary here and confusing at first glance until the reader remembers (if they know) that this is inserted (because of the -n) in a while (<>) { ... } loop.perl -lne 'print "$ARGV:$.:$_" if /\t/; close ARGV if eof' *
... so Yet Another Alternative :) would be to just wrap that in a shell (e.g. bash here) loop:perl -ne 'print "$ARGV:$.:$_" if /\t/' /tmp/foo
(more awkward/more steps, but potentially useful in certains cases)for f in * ; do perl -ne 'print "$ARGV:$.:$_" if /\t/' $f; done
|
|---|