[opensuse] using 'mail' from command line.
Hello, Using 'mail' in the command line and I can't find how to make it non-interactive. I want to just send the mail without it needing me to use a '.' (dot) to send the message. What is the correct syntax to send this on its way? I'd like to insert this into a script. mail -s DAILY-LOG -a /home/user1/IN*.log -c user2@example.com user1@example.com Thank you, James -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2008-03-04 at 14:24 -0800, James D. Parra wrote:
Using 'mail' in the command line and I can't find how to make it non-interactive. I want to just send the mail without it needing me to use a '.' (dot) to send the message. What is the correct syntax to send this on its way? I'd like to insert this into a script.
Use a pipe, with the contents of the email. I have used that in a script. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFHzdYStTMYHG2NR9URAlF6AJ9o1hWTwxagh8MVNhGsCq1fudY9xQCgiTER EV5aM4IwJs+/I/zi9fngOWA= =0u5a -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tuesday 04 March 2008 15:06:45 Carlos E. R. wrote:
The Tuesday 2008-03-04 at 14:24 -0800, James D. Parra wrote:
Using 'mail' in the command line and I can't find how to make it non-interactive. I want to just send the mail without it needing me to use a '.' (dot) to send the message. What is the correct syntax to send this on its way? I'd like to insert this into a script.
Use a pipe, with the contents of the email. I have used that in a script.
In typical Unix/Linux fashion, there are several ways to accomplish your goal:
In addition to the pipe suggested by Carlos, you can use at least two kinds of
input redirection:
1. Shell "here-document" (see 'man bash')
mail -s "Here document" me@somewhere.org <
participants (3)
-
Carlos E. R.
-
James D. Parra
-
Jim Cunning