On Thursday 19 September 2002 01:38 am, Peter Leftwich wrote:
| Tonight I surprised myself by running `find ~/Desktop/folder/ -name
| "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first
| custom find command line ever.
|
| But there were two issues -- I had to escape the semicolon with a "\"
Yes, it always works that way.
| -- does this ever cause problems for find command lines?
No, not really.
| Second,
| this found only *.jpg files and left behind *.JPG files so how do you
| make find be case-insensitive?
find ~/Desktop/folder/ \( -name "*.jpg" -o -name "*.JPG" \) \
-exec mv {} ~/Desktop/folderjpgs/ \;
Actually, what *I* do is avoid having files with capital letters in
them, or spaces, or &'s, or any of those other goofy characters you
sometimes find in Windows file names. Then I don't have to do the
above. I accomplish that with the attached pair of scripts, though
there are no doubts lots of other nice ways to do this.
(I run the "unmsdos" script over files that I download from the web or
newsgroups or what-have-you. It makes all of file names
"Unix-friendly" and, if the file is a text file, it invokes uncrnl to
change the cr-nl's at the ends of lines into just plan nl's.)
| -exec ThankYouScript.sh {} \;
--
Brian, the man from Babble-On . . . . [EMAIL PROTECTED] (personal)
unmsdos
Description: Perl program
uncrnl
Description: application/shellscript
