Skip to content

Instantly share code, notes, and snippets.

@tonY1883
Created March 4, 2018 08:05
Show Gist options
  • Save tonY1883/faf2798fb2464c189714ced5763a8bea to your computer and use it in GitHub Desktop.
Save tonY1883/faf2798fb2464c189714ced5763a8bea to your computer and use it in GitHub Desktop.
Script to convert a folder of jpgs into a single pdf
#!/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