abhay180 has asked for the wisdom of the Perl Monks concerning the following question:
I want to execute following perl-one-liner on a set of files (tmp_*) in a directory....
or% perl -e ' while (<>) { if (/: /) { $c += (split /: /)[0]; } } prin +t "SUM.$ARGV =$c\n"' tmp_*
so on..... Nothing seems to work...it just does for one file and exits.... Help%perl -e ' while (<>) { if (/: /) { $c += (split /: /)[0]; } } print + "SUM.$ARGV =$c\n"' | xargs cat tmp_filelist
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl onliner on multiple files
by BrowserUk (Patriarch) on Feb 08, 2013 at 19:44 UTC | |
by abhay180 (Sexton) on Feb 08, 2013 at 21:16 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2013 at 22:35 UTC | |
by 7stud (Deacon) on Feb 08, 2013 at 23:54 UTC | |
by abhay180 (Sexton) on Feb 09, 2013 at 10:05 UTC | |
by Anonymous Monk on Feb 09, 2013 at 09:24 UTC | |
Re: perl onliner on multiple files
by igelkott (Priest) on Feb 08, 2013 at 21:30 UTC | |
by abhay180 (Sexton) on Feb 09, 2013 at 10:12 UTC | |
Re: perl oneliner on multiple files
by jwkrahn (Abbot) on Feb 09, 2013 at 01:12 UTC | |
by abhay180 (Sexton) on Feb 09, 2013 at 10:18 UTC | |
by jwkrahn (Abbot) on Feb 09, 2013 at 19:52 UTC | |
Re: perl onliner on multiple files
by Anonymous Monk on Feb 08, 2013 at 19:45 UTC |
Back to
Seekers of Perl Wisdom