On Tue, Jan 07, 2003 at 10:19:09AM -0500, Kevin D. Clark <[EMAIL PROTECTED]> 
wrote:
> Assuming that none of the filenames contain embedded newlines or other
> strange characters:
> 
>   for A in `find ~/mamedk/roms2.mame.dk -name \*.zip -print | grep 
>'cur/[^/]*\.zip$'` ; do
>     cp "$A" ~/mamedk/roms
>   done

    I forget if you are one of the ones who considers spaces "stange
characters", but that general method breaks with filenames with spaces.
I general find that instead of:

for foo in `find blah`; do
    # do stuff
done

the following is typically more reliable:

find blah | while read foo; do
    # do stuff
done

-- 
Bob Bell <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
 "Parentheses in Perl are like shoes in the Caribbean."
   -- Larry Wall, creator of the Perl programming language
_______________________________________________
gnhlug-discuss mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss

Reply via email to