Help with Scriptoutput and mailing the log


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with Scriptoutput and mailing the log
# 15  
Old 09-28-2009
... this worked also, but i get the mail unformatted, too

Do i have a chance to format it?
# 16  
Old 09-28-2009
What do you mean by formating? If you want to send that mail in html format, use the header option (-a) like this:
Code:
mail -s "test txt" -a "Content-type: text/html; charset=iso-8859-1" eamil.address@host.com

# 17  
Old 09-28-2009
formating means, that the mail should like this:

Code:
Sun Sep 27 21:30:01 CEST 2009
Script Scriptname
Script1 was read - Success
Script2 was read - Success
Script3 was read - Success
Script4 was read - Success
Script5 was read - Success

... and not like this:

Code:
Script Scriptname
Script1 was read - Success Script2 was read - Success Script3 was read - Success Script4 was read - Success Script5 was read - Success

# 18  
Old 09-28-2009
It's strange. If the format is ok in your log file, it should also be ok when you pipe the output into the mail command. I have tried to reproduce your problem but the formating seems correct.

Code:
$ cat testmail.sh
#!/bin/bash
echo -n "Sript 1 was read -"
echo  "Success"

echo -n "Sript 2 was read -"
echo  "Success"

Code:
$ ./testmail.sh | mail -s "test mail" address@host.com

Code:
Message 22:
From ******@****.be Mon Sep 28 16:05:08 2009
Envelope-to: jeanluc@ibm
Delivery-date: Mon, 28 Sep 2009 16:05:08 +0200
To: jeanluc@ibm
Subject: test
From: *******
Date: Mon, 28 Sep 2009 16:05:08 +0200

Sript 1 was read -Success
Sript 2 was read -Success

Maybe something in your mail client? Or try forcing the Content-type to text.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Mailing the job log

Hi All, i am a begginner in autosys. i want the job log to be mailed if a job gets failed in autosys.please help me with this (0 Replies)
Discussion started by: sahe
0 Replies

2. UNIX for Advanced & Expert Users

Regarding mailing of logs

Hi Folks, I have an application which logs get continuously refreshed and made after every 1 second , I want that those logs get mailed to me at my email id sara@somewhere.com The location is cd /var/log/abc/log Please advise the command so that I can mail abc.log at my mailid inbox... (2 Replies)
Discussion started by: SankalpS
2 Replies

3. UNIX for Dummies Questions & Answers

Regarding mailing of logs

Hi Folks , I have one query I traverse to a location where logs are being made daily, Now I want that a particular log in that logs directory to be get mailed to me automatically at a particular time on daily basis at my mail id, Please advise the command for that.. for ex the directory is... (7 Replies)
Discussion started by: SankalpS
7 Replies

4. Shell Programming and Scripting

Mailing Script

Hi, I am totally New to This Scripting Area.We have developed some reports in Bo and User need those reports to be sent through Unix Server (SFTP). Can any one provide me script for transfering File from one location to other with the requirement like if that file fails to reach destination... (4 Replies)
Discussion started by: Sashanth_S
4 Replies

5. Shell Programming and Scripting

HTML mailing

Hi All, I have a comma separated file as below. file-1 ---------- a,b,c d,e,f g,h,i . . . I want to send the above file in Mail in HTML format with all the values of each column in separate cells i.e. the body of the mail should be in tabular format & each field should be separate... (2 Replies)
Discussion started by: 46019
2 Replies

6. Shell Programming and Scripting

Mailing script

Hi, I have a file lets say FILE1. FILE1 ------ name,age charlie,25 harry,29 david,32 Pls help me writing a mailing script.... which will mail the content of file in the body of the mail & it will look something like below in two columns. name age charlie 25 harry 29... (1 Reply)
Discussion started by: 46019
1 Replies

7. Shell Programming and Scripting

Mailing Problem

I have a Unix server with SunOS 5.8 installed on it. I have set a cron job which will send mail across the two different networks. As of now i can only send mails to the abc.com who owns the server but would also like to send it to xyz.com is there any setting or parameter wherein i need to add... (2 Replies)
Discussion started by: nimish
2 Replies

8. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx... (4 Replies)
Discussion started by: gayath3
4 Replies

9. Shell Programming and Scripting

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx -s... (0 Replies)
Discussion started by: gayath3
0 Replies

10. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I'm fairly new to using Unix and I was just wondering can someone please tell me the simplest way to mail and attachement using the mail command using Solaris? I have tried using uuencode file name | mail johndoe@ttp.ie but it hasn't worked. I have been mailing the file to myself using... (4 Replies)
Discussion started by: gerwhelan
4 Replies
Login or Register to Ask a Question