[olug] sed and sh

Jon H. Larsen relayer at omahadirect.net
Wed Feb 5 13:06:53 UTC 2003


Thanks to all for the suggestions.  My original Sed script worked out fine 
after I solved my own mistake. :)

Jon L.

On Tue, 4 Feb 2003, Jon H. Larsen wrote:

> Date: Tue, 4 Feb 2003 15:13:13 -0600 (CST)
> From: Jon H. Larsen <relayer at omahadirect.net>
> Reply-To: olug at olug.org
> To: olug at olug.org
> Subject: [olug] sed and sh
> 
> 
> 
> I'm currently modifying a script that came with Hylafax where I am 
> attaching a PDF version of the Tif fax document to an email, and 
> delivering it.
> 
> I created a TEST script to work on the bit of code that I need to truncate 
> the filename.
> 
> #!/bin/sh
> #
> # trunctest.sh
> 
> 
> FILE="$1"
> TRUNCFILE=`echo $FILE | /bin/sed -e 's/recvq\///' | /bin/sed -e 's/\.tif//'`
> 
> echo $TRUNCFILE
> 
> 
> Run it like so:
> ./trunctest.sh recvq/fax00022.tif
> 
> output:
> fax00022
> 
> Works great.
> 
> When I stick the lines in the production faxrcvd script, output is always 
> blank. 
> 
> FILE="$1"
> TRUNCFILE=`echo $FILE | /bin/sed -e 's/recvq\///' | /bin/sed -e 's/\.tif//'`
> 
> $TRUNCFILE is only used in echo statements in the script, and is only 
> defined once. 
> 
> I've tried to use some of the PDF scripts provided by another source, but 
> they didn't work as I had expected them.  This truncate issue is the only 
> thing holding me back from putting fax receive into production in our 
> environment (send has been running for a year now).  The script will 
> deliver a PDF, but I'd rather have a more descriptive filename other than 
> ".PDF" on the attachment. :)
> 
> Puzzled...
> Jon L.
> 
> 
> 

-- 
 [ Jon H. Larsen  - email: relayer at omahadirect dot net         ]
 [ ICQ#: 10412618 - http://www.animesunday.org/jonl               ]
 [ PGP Pubkey - http://www.animesunday.org/jonl/relayerpubkey.txt ]
 [ OpenOffice.org - Freedom at Work - http://www.openoffice.org   ]




More information about the OLUG mailing list