Created
March 4, 2018 08:05
-
-
Save tonY1883/faf2798fb2464c189714ced5763a8bea to your computer and use it in GitHub Desktop.
Script to convert a folder of jpgs into a single pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "* * * * * * * *" | |
echo "* .JPG to .PDF File Converting Utility *" | |
echo "* By tonY1883@GitHub *" | |
echo "* * * * * * * *" | |
sleep 1 | |
read -p "Please input the name of the folder:" -e input | |
sleep 1 | |
echo "Reading folder..." | |
sleep 1 | |
echo "File to convert:" | |
ls -v $input/*.jpg | |
sleep 1 | |
read -r -p "Convert? [y/N] " response | |
case $response in | |
[yY][eE][sS]|[yY]) | |
echo "Converting...." | |
sleep 1 | |
convert `ls -v $input/*.jpg` -verbose $input.pdf | |
echo "Done." | |
;; | |
*) | |
echo "Operation cancelled." | |
;; | |
esac | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment