I'm trying to use the variable $y in this snippet below but keep running into the filename showing up as $y.pdf
ls -v *.jpg | tr '\n' ' ' | sed 's/$/\ $y.pdf/' | xargs convert
I've also tried the below:
ls -v *.jpg | tr '\n' ' ' | sed 's/$/\'"$y.pdf"'/' | xargs convert
ls -v *.jpg | tr '\n' ' ' | sed 's/$/\ {$y}.pdf/' | xargs convert
The top one usually fails, as sed is expecting something else. The bottom one just makes my filename {$y}.pdf.
Any ideas for me?
Thanks!