I use this commandline to convert jpegs to pdfs inside a folder.
for f in *.jpg; do echo "Converting $f"; convert "$f" "$(basename "$f" .jpg).pdf"; done
However, I would like to convert all .jpg from several folders to .pdf located inside the samefolder. I need a bash command which says "go inside folder A, launch the conversion to pdf and when it is done, go to folder B and do the same".
Also jpeg file could be ended by .jpg or .JPG.
My folder structure is such as:
Folder A
File1.jpg
File1.jpg
File1.jpg
File1.jpg
File1.jpg
Folder B
File1.jpg
File1.jpg
File1.jpg
...
Any idea about how to achieve this?
find
with the-execdir
action. – glenn jackman Feb 25 '19 at 15:52