LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-14-2003, 11:54 AM   #1
QuakerOatz
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.

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!
 
Old 07-14-2003, 12:04 PM   #2
QuakerOatz
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:

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


Reply



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-30-2004 11:37 PM
Bash script - repeated command satimis Programming 27 10-28-2004 05:02 AM
bash connot find the command Dunadan1821 Linux - Software 9 08-30-2004 08:04 AM
bash cant find format or mkfs command Dunadan1821 Linux - Software 3 08-12-2004 01:27 PM
Simple Bash Script Help Command kemplej Linux - Software 1 03-11-2004 03:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:47 PM.

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