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 07-07-2014, 02:56 PM   #1
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 223

Rep: Reputation: Disabled
bash script for auto converting images to pdfs


Hi
I want to create a bash script which can work in the following way:
Code:
cd /home/zetro/books/
cd book1
convert * book1.pdf
cd ../book2
convert * book2.pdf
cd ../book3
.
.
.
untill it converts all the jpegs into their respective pdfs.
Can anyone help me to acomplish this task?
Regards
 
Old 07-07-2014, 03:07 PM   #2
canussie
Member
 
Registered: Jun 2014
Location: Calgary
Posts: 50

Rep: Reputation: 7
#!/bin/bash
DIR=/home/zetro/books

for i in `ls $DIR`
do convert $DIR/$i/* $DIR/$i/$i.pdf
done
 
2 members found this post helpful.
Old 07-08-2014, 09:01 AM   #3
zetrotrack000
Member
 
Registered: Dec 2011
Posts: 223

Original Poster
Rep: Reputation: Disabled
Thanks a lot
 
Old 07-08-2014, 09:59 AM   #4
canussie
Member
 
Registered: Jun 2014
Location: Calgary
Posts: 50

Rep: Reputation: 7
No problem
 
  


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
[SOLVED] Converting Script from Linux (GNU) Bash 4 to Solaris Bash 2.05 - Any cheat sheet? oly_r Solaris / OpenSolaris 6 05-03-2013 09:25 AM
converting a py script to bash saawan Linux - Software 2 05-06-2009 12:56 PM
converting bash script to csh DJOtaku Programming 8 02-13-2006 06:35 AM
converting .tif images to an animated .gif file with a script illiniguy3043 Programming 2 06-01-2004 04:11 PM
converting .tif images to an animated .gif file (Red Hat 7.2, bash shell) illiniguy3043 Linux - General 0 06-01-2004 02:07 PM


All times are GMT -5. The time now is 10:28 AM.

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