bash scripting question

Hal Duston hald at sound.net
Thu Feb 13 20:58:42 CST 2003


On Thu, 13 Feb 2003, Charles Steinkuehler wrote:

> ls -1 save* | sed '1,10d' | > while read FILE ; do
>    rm -rf $FILE
> done
> 
> This avoids ever expanding the file list completely.
> 

Well, if you're going to do this, might as well do

ls -1 save* | sed '1,10d' | xargs rm -rf

and save the while loop, and a greatly reduce the number of
calls to `rm -rf'.

Hal




More information about the Kclug mailing list