| Hylafax Mailing List Archives | 
| 
 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 
  | 
    ![]()  | 
    
  |