Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-14-2003, 12:54 PM   #1
LQ Newbie
Registered: Jul 2003
Posts: 3

Rep: Reputation: 0
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.

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

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

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!
Old 07-14-2003, 01:04 PM   #2
LQ Newbie
Registered: Jul 2003
Posts: 3

Original Poster
Rep: Reputation: 0
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:

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
trouble with find command in bash vrdhananjay Linux - Newbie 3 10-31-2004 12:37 AM
Bash script - repeated command satimis Programming 27 10-28-2004 06:02 AM
bash connot find the command Dunadan1821 Linux - Software 9 08-30-2004 09:04 AM
bash cant find format or mkfs command Dunadan1821 Linux - Software 3 08-12-2004 02:27 PM
Simple Bash Script Help Command kemplej Linux - Software 1 03-11-2004 04:52 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration