arg list to long wnad while command

From: John Dunn (john.dunn@SEFAS.CO.UK)
Date: Mon Mar 17 2003 - 05:50:51 EST


I currently have a script that does the following

    ls -ltr *.$EXTENSION 2>/dev/null | while read FILESTATUS NUMBER OWNER
GROUP

    do

        something

    done

I am hitting the arg list too long problem on the ls command when there are
a long list of files

I have tried replacing ls with find but get an error that "do is unexpected"

find . -name '*.$EXTENSION' | xargs while read FILESTATUS NUMBER OWNER
GROUP

Can anyone help with the syntax required, please

John



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:40 EDT