LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   same find command not working in bash script, quotes? (https://www.linuxquestions.org/questions/linux-software-2/same-find-command-not-working-in-bash-script-quotes-72629/)

QuakerOatz 07-14-2003 11:54 AM

same find command not working in bash script, quotes?
 
I use the following command to shrink photos in a particular directory. The command works perfectly from the bash shell command line.

Code:

find . -iname '*.jpg' -exec convert {} -resize 50%x50% -quality 75 {} \;

... but once I throw this line a bash script, I get

Quote:

find: missing argument to `-exec'
I've written a few hundred bash scripts and have never encountered this problem. find seems to be extremely picky in its notation and has a few "quirks" that I haven't encountered with any other command.

Thanks for the help!

QuakerOatz 07-14-2003 12:04 PM

Errr.. I figuired this out about 10 seconds after posting. Besides wasting disk space, perhaps this may be of some to others... for some reason I needed to escape the { and } when using the find command in the shell script... wierd. So this is what worked:

Code:

find . -iname '*.jpg' -exec convert \{\} -resize 50%x50% -quality 75 \{\} \;


All times are GMT -5. The time now is 01:44 PM.