Page 1 of 1

issue with mail syntax in unix

Posted: Wed Sep 13, 2006 7:56 pm
by vinay_renu2001
Hi

I have an issue with the mail syntax:

Here it is

mail -s $EMAILSUBJECT $EMAILADDRESS < EMAILFILE

Variable $EMAILSUBJECT is suppose to substitute the value of it as a subject. But it is not doing that. I tried to put in quotes also. Instead of taking the variable value it is sending one of the email id from the variable "$EMAILADDRESS" as subject.

Actually, this is on:
Linux nps23194 2.6.9-34.ELsmp

Execuse me for posting a non PX post.

Can anyone give their suggestions!!

Thanks

Posted: Wed Sep 13, 2006 8:32 pm
by ray.wurlod
Is the variable EMAILSUBJECT actually defined? If it were not, you would see the behaviour you are describing.

Posted: Wed Sep 13, 2006 9:02 pm
by kduke
mailx -s "$SUBJECT" $USERS

Works fine for me.

Posted: Thu Sep 14, 2006 12:27 pm
by vinay_renu2001
kduke wrote:mailx -s "$SUBJECT" $USERS

Works fine for me.

Hi duke,

I made some progress on this, but, When i tried to use the same, I have a big sentence of subject in between spaces for each word.

Now, when i tried to use the above, its putting the first word of the sentence as a subject and the rest of the sentence is taking as email id's.

I tried placing the quotes in various ways (single and double), but none of them worked.

Can you please help me on this.

Hi Ray,

Variable EMAILSUBJECT was defined.


Thanks