Желаю всем интересно и весело провести это время, лета осталось не так уж и много.
С уважением, Олмер.
#!/bin/sh
clear
mkdir pdf;
for f in *.jpg ; do convert "$f" "./pdf/${f%.jpg}_converted.pdf"
echo "------------->./pdf/${f%.jpg}_converted.pdf......Ready!"
done
for f in *.jpg ; do
if [ -f ./pdf/temp.pdf ]; then
echo "Temp file exist"
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=./pdf/temp.pdf -dBATCH ./pdf/all.pdf
echo "Add current file to All.pdf"
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=./pdf/all.pdf -dBATCH ./pdf/temp.pdf "./pdf/${f%.jpg}_converted.pdf"
else
echo "Temp file not exist...create!"
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=./pdf/temp.pdf -dBATCH "./pdf/${f%.jpg}_converted.pdf"
echo "Add current file to All.pdf"
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=./pdf/all.pdf -dBATCH ./pdf/temp.pdf
fi
done
echo "Delete Temp.pdf"
rm ./pdf/temp.pdf
echo "Done...!"