Hylafax Mailing List Archives

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

Re: [hylafax-users] Change the naming for received faxes



Here is my solution to renaming received faxes to identify the device on which the fax was received.  I was unable to figure out how to use the sed command to edit the filename with $DEVICE, so I am using the if command.
 
I am using Suse 8.1 Professional with Digi Acceleport Xem, configured with 3 modems.
 
In an attempt to understand what was happening with each line, I have place comments before the command.  If my explanation of what is happening is incorrect, feel free to correct me.   I added the following at line 107 of faxrcvd:
 
# rename fax received to identify the modem
if [ $DEVICE = "ttya01" ]; then
# Create Variable NEWFILE by substituting "faxa01"
# for "fax" in the characters defined by FILE
     NEWFILE='echo $FILE | sed 's/fax/&a01/g'`
# NEWFILE is now equal to faxa01XXXXX where
# XXXXX is the fax number as determined by
# /var/spool/fax/recvq/seqf
# Now, rename the original file, $FILE (faxXXXXX)
# to $NEWFILE (faxa01XXXXX)
     mv $FILE $NEWFILE
# Now reset FILE so that it is equal to the new filename
     FILE=$NEWFILE
     elif [ $DEVICE = "ttya02" ]; then
         NEWFILE='echo $FILE | sed 's/fax/&a02/g'`
         mv $FILE $NEWFILE
         FILE=$NEWFILE
         elif [ $DEVICE = "ttya03" ]; then
             NEWFILE='echo $FILE | sed 's/fax/&a03/g'`
             mv $FILE $NEWFILE
             FILE=$NEWFILE
fi
 
John
----- Original Message -----
Sent: Friday, October 22, 2004 10:38 AM
Subject: [hylafax-users] Change the naming for received faxes

Hi,
 
Can someone possibly help me?  I would like to have the file names of the fax received identify the port on which the fax was received by replacing "fax" with the last 3 characters of the Device ID.  For example:  for the modem ttya01, I would like the filename for the fax received to be something like a01-0001.tif instead of fax00001.tif
 
I have searched the mailing list archives, support documentation and man pages but can't find an answer.
 
Any help is appreciated.  Thanks!
 
John


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