PDA

View Full Version : egrep: The parameter or environment lists are too long.



G|N|
February 4th, 2008, 03:25 PM
Hello,

I am writing a little bash script with an egrep expression.
The egrep command has to parse a lot of files and in some directories i get this error:


/usr/bin/egrep: The parameter or environment lists are too long.


How can i make the list use more files?

This is the expression:

egrep -i '(DEF|DEFINE).*TEMP-TABLE.*' *.i > $TEMP_FILE

Amit Yaron
February 4th, 2008, 04:12 PM
Use a 'for' loop:

for file *.i
do
egrep -i '(DEF|DEFINE).*TEMP-TABLE.*' $file >> $TEMP_FILE
done