HylaFAX The world's most advanced open source fax server

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

Re: [hylafax-users] Having problems running sendfax from a bash script.



John Warren wrote:

First, I'm new to writing bash scripts.

I have a string name "commandline" that contains the following:

sendfax -f jwarren@xxxxxxxxxxxxx <mailto:jwarren@xxxxxxxxxxxxx> -n -D -i 010000TESTFL -c "This is a test fax" -d Parmacist@13106421032 /var/spool/hylafax/windows/jobs/QueuedT/00TESTFL.pdf

If I do the following in a bash script it fails with "is: Can not open file"

$command

If I remove the ( -c "This is a test fax" ) or change it to ( -c "test" ) it works.

If I execute the same line outside of the script it also works.

Is the Bash script taking out the "'s and if so how do I keep it from doing this?


Sounds to me like you're creating some kind of COMMANDLINE variable and then exec'ing that variable later. In that case you'll need to make sure to escape your quotes so that they don't get eaten by the first parsing when it's placed into $COMMANDLINE...

COMMANDLINE="sendfax -c\"This is a test fax\" -d Pharmacist@13106421032"

Lee.


____________________ 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@xxxxxxxxxxx < /dev/null *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions