Doxxer
July 26th, 2010, 09:02 AM
Hi guys
at first im totally new to programming and linux stuff.
I need help with a switch case loop that should convert some files (.jpg .png etc to .pdf) using the imagemagick convert command and later on convert doc, xls etc to pdf using the JODConverter.
i am using the shell of ubuntu ("bash" i think)
so the basic script should somewhat look like:
#!/bin/bash
for i in "/my_folder"
switch "no idea"
case .jpg
do convert test.jpg basename.pdf
#if not do nothing
case .png
do convert test2.png basename.pdf
#if not do nothing
done
and so on ...
sorry i dont have much exp. with programming and stumbled my way through some of the tutorials but none of them referred to such a problem
i would be really glad if you could help me with the syntax
all i was said is that it should be a for i in / do switch case script that should convert those files into .pdf
(folder if this or another doesnt matter... i think i can change that afterwards)
sorry for my bad english
and thanks for any help in advance
Greets Doxxer
at first im totally new to programming and linux stuff.
I need help with a switch case loop that should convert some files (.jpg .png etc to .pdf) using the imagemagick convert command and later on convert doc, xls etc to pdf using the JODConverter.
i am using the shell of ubuntu ("bash" i think)
so the basic script should somewhat look like:
#!/bin/bash
for i in "/my_folder"
switch "no idea"
case .jpg
do convert test.jpg basename.pdf
#if not do nothing
case .png
do convert test2.png basename.pdf
#if not do nothing
done
and so on ...
sorry i dont have much exp. with programming and stumbled my way through some of the tutorials but none of them referred to such a problem
i would be really glad if you could help me with the syntax
all i was said is that it should be a for i in / do switch case script that should convert those files into .pdf
(folder if this or another doesnt matter... i think i can change that afterwards)
sorry for my bad english
and thanks for any help in advance
Greets Doxxer