in reply to Enclosing one-liner in a bigger loop - unix

Just replace the filename with a wildcard such that your command line becomes

perl -lne '/^([^\t]*)\t/; $hash{$1}++}{print $_ foreach(keys %hash)' *

Is that all you were after?

Replies are listed 'Best First'.
Re^2: Enclosing one-liner in a bigger loop - unix
by baxy77bax (Deacon) on Apr 24, 2015 at 08:59 UTC
    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)

      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'