I have a bash script with a line that was originally this
convert '%d.jpg[1-300]' combined.pdf
Uses convert from Imagemagick to strap a load of sequentially numbered jpgs in to a PDF.
I've written a basic script to accept user input for a changeable number of pages and tried to swap the 300 for a variable set by the user when the script runs using read -p to make this:
convert '%d.jpg[1-$pages]' combined.pdf
The rest of the script works fine but it fails on this line and I'm not sure why. Any suggestions?
I suspect its something to do with incorrect delimiters but I don't know the correct thing to look for.
convert '%d.jpg[1-'"$pages"']' combined.pdf