Re:Introducing features from AWK into egrep is sil
Posted by: Anonymous Coward
on June 01, 2006 02:06 PM
"Besides, run a grep on a couple of thousand files with a few hundred thousand lines in them each, and then run awk on it. Compare the time difference"
Actually, a UNIX guru would laugh in your face for your obvious inexperience: (smile)
Clearly you have never done what you suggest.
To do what you suggest you need to write a bash script that uses find to feed files to xargs which feed files to grep, otherwise you will max out on things like "list of arguments too long".
Using bash find and grep is quite slow.
With awk you can use its built in programming language to do this (note that you will need to use the close() function to make sure you don't max out on the allowed number of open files).
Re:Introducing features from AWK into egrep is sil
Posted by: Anonymous Coward on June 01, 2006 02:06 PMActually, a UNIX guru would laugh in your face for your obvious inexperience: (smile)
Clearly you have never done what you suggest.
To do what you suggest you need to write a bash script that uses find to feed files to xargs which feed files to grep, otherwise you will max out on things like "list of arguments too long".
Using bash find and grep is quite slow.
With awk you can use its built in programming language to do this (note that you will need to use the close() function to make sure you don't max out on the allowed number of open files).
Using awk many times faster because of this.
TRY IT. (See man time).
#