| Newsgroups |
gmane.mail.blat |
| Message-ID |
<[email protected]> |
Chip, you are right about the quotes being included in the environment variable, and I apologize for my typographical error (forgetting the “-to’ in the Set to= command).
Taking environment variables one step further, the quotes are not needed at all. It will take the entire string, including the embedded space.
Set to=-to eMail\@MyDomain.com
will give the correct string. Only if an ampersand “&” is in the string would quotes be required so that the command processor does not think that what follows the ampersand is a new command.
Ernest
From: mailto:[email protected]
Sent: Thursday, March 12, 2015 11:54 AM
To: [email protected]
Subject: Re: [blat] blat within batch script - not running
> IMHO -
> I believe that where you have the quotes in your set commands is OK, but
> the spaces around the equal signs is not. You
show in your email
>
>> set to = "-to eMail\@MyDomain.com"
>> set f = "-f eMail\@MyDomain.com"
>> set server = "-server smtp.MyDomain.com"
>
> I would instead code
> Set to=”eMail\@MyDomain.com”
> Set f=”-f eMail\@MyDomain.com”
> Set server=”-server smtp.MyDomain.com”
>
> A SET command without any parameters will display the contents of all the
> environment variables so you can check to see if they are set as you wish.
>
> Good luck
> Ernest
The issue with your method is that those quotation marks are passed to Blat
directly, and the C command line pre-parser will treat the data within those
quotation marks as a single entity. Blat does not have any option "-to
email\@mydomain.com", but it does have an option "-to". If you put the
quotation marks immediately before the environment variable as I had shown,
then the environment variable does not carry the quotation marks, thus Blat
would be given all parts of the environment variable content and that would
be treated properly by the C command line pre-parser.
The correct way to get spaces embedded into his data would be to have the
set commands as I have shown:
set "to=-to [email protected]"
set "f=-f [email protected]"
set "server=-server smtp.MyDomain.com"
Make sure there are no spaces before the equals sign, because spaces there
can create different environment variables than intended.
Chip