Hylafax Mailing List Archives

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

[hylafax-users] fax number from input file?



X-Evolution-Transport: sendmail:
X-Evolution-Fcc: file:///home/micke/evolution/local/Sent
Organization: 
Date: 23 May 2003 14:54:04 +0300
Message-Id: <1053690844.23795.282.camel@dsl-hkigw1m01>
Mime-Version: 1.0
X-Evolution: 00000156-0010

Hi, 

Configuration SuSE 8.1
Hylafax 4.1.3
modem external Multitech

I have written a bash script to send faxes using HylaFax.
I am trying to take the number from the first row in the "file", but
then sendfax is showing errors in xferfaxlog file (the number is dialed,
but when the transmitting of fax should begin, the line is dropped).
If I assign the numer directly to a variable, then everything works.
The only difference is in the assignment of variable number.
 What is the difference in the variable? Why doesn't sendfax like it?


Working script (but then I can't have a dynamic number):

#!/bin/bash
cat > /tmp/faxtemp$$
number="0407715761"
nrlines=`wc -l /tmp/faxtemp$$ | cut -c0-7`
nrlines=`expr $nrlines - 1`
tail -n $nrlines /tmp/faxtemp$$ > /tmp/faxtemp_$$
file="/tmp/faxtemp$$"
nnumber="0$number"
sendfax -n -D -s a4 -d $nnumber  $file
rm /tmp/faxtemp$$
rm /tmp/faxtemp_$$
exit 0
-----
xferfaxlog OK line:
05/23/03 13:38  SEND    00000094        modem   83      ""     
root@linux.local        "00407715761"   ""      4193919 0       0:37   
0:00    "Busy signal detected"



Not working:

#!/bin/bash
cat > /tmp/faxtemp$$
number=`head /tmp/faxtemp$$ -n 1 |awk  '{print $1}'`
nrlines=`wc -l /tmp/faxtemp$$ | cut -c0-7`
nrlines=`expr $nrlines - 1`
tail -n $nrlines /tmp/faxtemp$$ > /tmp/faxtemp_$$
file="/tmp/faxtemp$$"
nnumber="0$number"
sendfax -n -D -s a4 -d $nnumber  $file
rm /tmp/faxtemp$$
rm /tmp/faxtemp_$$
exit 0

xferfaxlog NOT OK line:
"5/23/03""3:13  4193919 000000920:43    0:00m   "Unknown problem (check
modem power)"   "00407715761


____________________ HylaFAX(tm) Users Mailing List _______________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
 On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
  *To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services