vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Please help in creating this shell script, its to email users regarding a process status I want to generate a email from a system, attach a log file to it, everytime this script is run, towards the end of it mail a1@a1.com, a2@a1.com, b2@b1.com how to include this in the script, i want to avoide the ^C everytime and automatically see my emails thru. Thanks JN |
| ||||
| Unix-Solaris wrote: > Please help in creating this shell script, its to email users regarding > a process status > > I want to generate a email from a system, attach a log file to it, > everytime this script is run, towards the end of it > > mail a1@a1.com, a2@a1.com, b2@b1.com > > how to include this in the script, i want to avoide the ^C everytime > and automatically see my emails thru. If what you want is in a file: mailx \ -s "subject goes here" \ a1@a1.com a2@a1.com b2@b1.com \ < message-body If you want to pipe some commands into it: { date echo "------ 'myfile' follows ------" cat myfile echo "------ end of 'myfile' -------" } | mailx \ -s "subject goes here" \ a1@a1.com a2@a1.com b2@b1.com If you really need to *attach* a file (as opposed to just including it in the content of the message), the easiest way to do that is to install the "mutt" mail client ( http://www.mutt.org/ ), which lets you attach files with the "-a" command-line option. Hope that helps... - Logan |