Last active
September 7, 2023 19:00
-
-
Save User4574/ff89aa301eb893b20a18e5b5ce8c6019 to your computer and use it in GitHub Desktop.
Batch scanning script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function scanpage { | |
echo -n insert $1 and press return | |
read | |
scanimage \ | |
-d 'brother5:bus2;dev2' \ | |
--AutoDocumentSize=yes \ | |
--format=pdf \ | |
--resolution 300 \ | |
--AutoDeskew=yes \ | |
-o $1 2>/dev/null | |
} | |
if [[ -z $1 ]] ; then | |
echo -n 'prefix ?' | |
read pref | |
[[ -z $pref ]] && exit | |
else | |
pref=$1 | |
shift | |
fi | |
if [[ -z $1 ]] ; then | |
while true ; do | |
echo -n 'document#(s) ?' | |
read n | |
[[ -z $n ]] && exit | |
for j in $n ; do | |
scanpage ${pref}-$j.pdf | |
done | |
done | |
else | |
for j in $* ; do | |
scanpage ${pref}-$j.pdf | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment