LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2012, 02:08 PM   #1
jat421
LQ Newbie
 
Registered: May 2012
Posts: 12

Rep: Reputation: Disabled
loop into each folder


Hi, I am trying to write this script to convert tiff to PDF's. How do I tell the script to go(loop) into each folder under Incoming and perform the tiff2pdf.

For example under /mnt/fs/Incoming there are few folder and in each folder there are .tiff files to convert. Thanks for any help!
Code:
for f in /mnt/fs/Incoming/*.tif; do tiff2pdf -o "${f%.tif}".pdf "$f"; done
 
Old 05-29-2012, 02:54 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,122

Rep: Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270Reputation: 2270
have you tried to use the command find?
find /mnt/fs/Incoming -type f -name \*.tif -exec <little script to do the job with arg[1]> {} \;
 
  


Reply


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
how to loop over text file lines within bash script for loop? johnpaulodonnell Linux - Newbie 9 07-28-2015 04:49 PM
[SOLVED] Bash - While Loop reading from two lists simultaneously - nested while loop wolverene13 Programming 11 10-01-2011 06:00 PM
for loop or while loop to read the fields of a file.. visitnag Linux - Newbie 10 09-02-2010 09:47 PM
bash loop within a loop for mysql ops br8kwall Programming 10 04-30-2008 04:50 AM


All times are GMT -5. The time now is 10:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration