Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

mailx command issue

Go to solution
Regular Advisor

mailx command issue


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


Patrick Wallek
Honored Contributor

Re: mailx command issue

Try this:


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