Code: Alles auswählen
#!/bin/bash
if [ -z "$1" ]; then
echo 'Please provide the name of the output PDF file.'
exit 1
fi
SCAN_DIR=/home/mh/temp/_scans
if [ ! -d $SCAN_DIR ]; then
mkdir -p $SCAN_DIR
fi
scanimage \
-d "genesys:libusb:003:003" \
--batch=$SCAN_DIR/out%d.pnm \
--source "Flatbed" \
-x 210 -y 297 --resolution 300 \
--batch-prompt
gm convert $SCAN_DIR/out*.pnm $1
rm $SCAN_DIR/out*.pnm
Ich habe von Scripten ein vollkommen oberflächliches Verständnis! So setzt bitte so gut wie nichts voraus.