Re: mailx command issue (192 Views)
Reply
Regular Advisor
itrc55
Posts: 195
Registered: ‎04-10-2010
Message 1 of 2 (199 Views)
Accepted Solution

mailx command issue

Hi,


i wrote one script to send the result of ignite backup to my mail, but i facing problem with mailx command

how can i send mail in one line like below

 

=============
SUCCESS=$(tail ${LOG} | grep "completed successfully") ======> this is variable include text output
.
.
.

if [ "${PASSFAIL}" = "successfully!" ]; then

 

mailx -s "${SUBJ}" ${ADMINS} $SUCCESS    =====> here my problem

=============

 i need to send the content of "$SUCCESS" variable, where in this syntax system will make the "$SUCCESS" as sender not body of mail


What is the correct syntax to do that  ? or if is there other way to resolve this problem


Thanks

Please use plain text.
Honored Contributor
Patrick Wallek
Posts: 13,711
Registered: ‎06-21-2000
Message 2 of 2 (192 Views)

Re: mailx command issue

Try this:

 

echo $SUCCESS | mailx -s "${SUBJ}" ${ADMINS}

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation