1748181 Members
4037 Online
108759 Solutions
New Discussion

mailx command issue

 
SOLVED
Go to solution
itrc55
Regular Advisor

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

1 REPLY 1
Patrick Wallek
Honored Contributor
Solution

Re: mailx command issue

Try this:

 

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