The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
xargs problem encrypted Shell Programming and Scripting 3 05-16-2009 12:15 PM
String substitution on find results inside exec/xargs myndcraft Shell Programming and Scripting 2 05-17-2008 02:36 PM
command usage on find with xargs and tar darkrainbow AIX 3 12-25-2007 06:25 PM
strange behavior of find with xargs jerardfjay Shell Programming and Scripting 9 08-09-2007 08:06 AM
find | xargs cat asal_email Shell Programming and Scripting 4 03-17-2005 12:16 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-01-2008
quixote quixote is offline
Registered User
  
 

Join Date: May 2008
Posts: 4
Problem using find and xargs

I'm using Imagemagick to create thumbnails for a large directory tree. The only thing I can't see is how to get it to write the thumbnails to a "thumbs" subdirectory!

Either of these two commands from the Imagemagick site does most of the job:

Code:
find -name '*.jpg' | xargs -n1 sh -c 'convert $0 -format gif -thumbnail 160x160 thumbs/$0.gif
which gives me this error
Code:
`thumbs/./Moorpark/PCR-Workshop/03intro.jpg.gif': No such file or directory
or this one:
Code:
find * -name '*.jpg' -exec convert '{}' -format gif -thumbnail 160x160 thumbs/'{}'.gif \;
which gives me this error:
Code:
`thumbs/Moorpark/PCR-Workshop/03intro.jpg.gif': No such file or directory
Either way, that thumbs subdirectory is always assumed to be relative to the dir from which the command was executed rather than the subdir being processed. It'll process and rename files in the top level dir just fine.

How do I tell it to look for "thumbs" under the subdir it's processing? ?? I've studied the man pages, tried googling everything I could think of, tried variants I invented (that was the most hopeless of all!) and gotten nowhere.

I did manually make all those "thumbs" subdirectories. Ideally, I'd also like to be able to tell it to make that directory on the fly, but that's my next problem, unless someone has the answer.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0