[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problem mit Variabeln in einem sh-Script



Hallo zusammen,

es geht um ein Script (1) aus dem brscan Paket (Scannertaste eines Brother 
Multifunktionsgerät nutzen), welches ich zu tunen versuche.

Das Ergebnis:
scanned_2008-02-25_20-33-10-_-600-dpi.pnm

Wie komme ich zu folgendem Ergebnis?
scanned_2008-02-25_20-33-10-(600-dpi).pnm

Wenn ich
mv ~/brscan/$tmp ~/brscan/scanned_$timestamp-($resolution-dpi).$extension
versuche, dann bekomme ich einen Fehler "unexpected near broken (" oder so 
ähnlich (wer es genau wissen muss, dann poste ich es später, der betroffenen 
PC ist grad down)

Danke schonmal, Chris......


(1)
Hier das Script (Kommentare entfernt):
-----------------------------
# cat /usr/local/Brother/sane/script/scantofile-0.2.1-1.sh
#! /bin/sh
set +o noclobber
resolution=300
device=$1
timestamp=`date +%Y-%m-%d_%H-%M-%S`
tmp=Please_wait__scanning_is_in_progress__$timestamp.tmp
extension=pnm
mkdir -p ~/brscan
if [ "`which usleep`" != '' ];then
    usleep 10000
else
    sleep  0.01
fi
output_file=~/brscan/$tmp
echo "scan from $2($device) to $output_file"
scanimage --device-name "$device" --resolution $resolution> $output_file
chmod 600 $output_file
mv ~/brscan/$tmp ~/brscan/scanned_$timestamp-_-$resolution-dpi.$extension
-----------------------------


Reply to: