Brothers Scankey-Tool

Hast Du Probleme mit Hardware, die durch die anderen Foren nicht abgedeckt werden? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
Benutzeravatar
Drache
Beiträge: 772
Registriert: 22.11.2009 05:49:55

Brothers Scankey-Tool

Beitrag von Drache » 26.11.2017 20:05:23

Hallo,

tl;dr eigentliche Frage ganz am Ende.

nach einiger Recherche habe ich jetzt herausgefunden, dass das Scankey-tool durchaus geht, allerdings übergibt das script von Brother eine Variable falsch:
Das Script sieht so aus:

Code: Alles auswählen

#! /bin/sh
set +o noclobber
#
#   $1 = scanner device
#   $2 = friendly name
#

#   
#       100,200,300,400,600
#
resolution=300
device=$1
mkdir -p ~/Dokumente/Digitalisate
if [ "`which usleep  2>/dev/null `" != '' ];then
    usleep 100000
else
    sleep  0.1
fi
output_file=~/Dokumente/Digitalisate/brscan_"`date +%Y-%m-%d-%H-%M-%S`"".pnm"
touch $output_file
#echo "scan from $2($device) to $output_file"
#scanimage --device-name "$device" --resolution $resolution> $output_file  2>/$
scanimage --device-name "$device" --resolution $resolution -x 210.00 -y 297.00$
#rm $output_file
if [ ! -s $output_file ];then
  if [ "`which usleep  2>/dev/null `" != '' ];then
    usleep 1000000
  else
    sleep  1
  fi
  scanimage --device-name "$device" --resolution $resolution> $output_file  2>$
fi
#echo  $output_file is created.
Das Ergebnis:

Code: Alles auswählen

scanimage: open of device brother4:bus4;dev3 failed: Invalid argument

Das Problem ist das "brother4" vorneweg, welches zu dem Fehler führt. Soweit ich das verstehe (und ich könnte mich täuschen) hängt die Variable $1 mit scanimage direkt zusammen, als $1 ist nur in Verbindung mit scanimage "brother4:bus4;dev3" ? Frage ich allerdings scanimage direkt um Hilfe (--help), wird nur die richtige Bezeichnung ohne brother4 am Ende ausgegeben…

Code: Alles auswählen

List of available devices:
    net1;dev0 bus4;dev3

Mein Problem: Die USB-Zuordnung ist nicht fest: bus4;dev3 kann ich also nicht ohne Variable übergeben, wie kann ich nun die Variable richtig zuschneiden (evtl. sed?) um im obigen Skript auf ein "$device" ohne brother4 zu kommen?
“Don't you think that if I were wrong, I'd know it?” (Dr. Sheldon Cooper)
XFCE: alt,steinhart,langweilig,immer noch da.

Antworten