Solved

How to eliminate tmp files for mailx

Posted on 2002-07-25
4
314 Views
Last Modified: 2010-04-21
I know how to use mailx, sending the contents of a file out as the email message or "Body"  

Is there anyway I can do this without using the tmp files and in a way similar to how the "subject" line is populated?

Ideal example (let x be the body option for illustration):

mailx -s "Subject Line" -x "Body or email message" mailusers@unixmail.com

Thanks!
0
Comment
Question by:Randy2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:bira
ID: 7178754
echo "Body or message"|mailx mailusers@unixmail.com
-s"subject Line"
0
 

Author Comment

by:Randy2001
ID: 7179987
bira,

That works! Thanks! I am going to accept your answer but before that could you tell me if its possible to add a message like you told me and then add the contents of a file.  

The email message (body) would look like this:

Here is my echo message

Here is the tmp file that I printed out with all kinds of wonderful ASCI text!

If not I will go ahead and accept you comment but if you can help I will add another 50.  Thanks!



0
 
LVL 6

Accepted Solution

by:
bira earned 75 total points
ID: 7180318
Randy2001
  Once you use the pipe (|), the mailx command interprets the input as the body or message.
 
   You could use as follow:
   
   cat yourfile | mailx mailusers@unixmail.com
-s"subject Line"

  But only one input. So i dont think it´s possible to do
  what you asked, using the pipe.

    Regards
0
 

Author Comment

by:Randy2001
ID: 7180352
OK.  Thanks anyway!
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question