Re: ls and while

From: Holger.VanKoll@SWISSCOM.COM
Date: Mon Mar 17 2003 - 06:13:41 EST


try
find . -name "*.$EXTENSION" -exec something {} \;

-----Original Message-----
From: John Dunn [mailto:john.dunn@SEFAS.CO.UK]
Sent: Monday, March 17, 2003 12:11 PM
To: aix-l@Princeton.EDU
Subject: ls and while

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