file-globs

Applying AWK on Set of Files with Same Extension

I want to apply the following "awk" command on files with extension "*.txt" awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' But why this command doesn't work: for i in *.txt do echo awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' $i; done Normally, awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' file1.txt would work. ...

How can I handle wildcards on the command line using Perl on Windows?

I though this would be simple, but apparently I can't do: script.pl *.ext in the WinXP command processor. Is there a built-in solution? (i.e. not a CPAN module?) ...