in reply to Re: Enclosing one-liner in a bigger loop - unix
in thread Enclosing one-liner in a bigger loop - unix

Ok, this is embarrassing. Thank you though... And the answer is yes

UPDATE:

Attempt to save the post.(Though I'll probably embarrass my self one more time)

How would one do this if one would like to know what was matched in each file .
Let the expected output be :

file1: match match match file two: match match ...
the same as grep function does. (Ano no, I don't want to use grep since I cannot hash)

Replies are listed 'Best First'.
Re^3: Enclosing one-liner in a bigger loop - unix
by Eily (Monsignor) on Apr 24, 2015 at 09:13 UTC

    Look at $ARGV which contains the current file name.

    And you could avoid the eskimo kiss if you want with something like: perl -lne '/^([^\t]*)\t/ and not $h{$1}++ and print $1'