diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
commit | a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 (patch) | |
tree | 4f2f232aca568711ecb35caa3444b54f4dfa4361 /scan.sh |
Migrate from gists
Diffstat (limited to 'scan.sh')
-rw-r--r-- | scan.sh | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#!/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 |