On 2005-10-14 10:47, Drew Tomlinson <[EMAIL PROTECTED]> wrote:
> On 10/14/2005 9:27 AM Paul Schmehl wrote:
> >for files in /my/dir/for/files/*.jpg
> >do
> >NEWFILES=`$files | cut -d'/' -f 6`
> >ln -s $files /new/dir/for/pics/$NEWFILES
> >done
>
> But there is still one problem. This won't search recursively which is
> why I was using find. However if I start with
>
> "for files in `find /multimedia -iname "*.jpg" -print"
>
> this would probably work. I'll try it and see. Or is there some
> other (better) way to search for files recursively?
find(1) is usually nice. One thing you may want to be careful about
with find in a for loop is that filenames with whitespace are probably
going to end up in a huge mess. It may be better to use something like
the following:
find /multimedia -iname '*.jpg' | \
while read fname ;do
# Manipulate ${fname}
done
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"