Operating System - HP-UX
1826428 Members
3906 Online
109692 Solutions
New Discussion

Re: Again need help in scripting

 
SOLVED
Go to solution
Shikha Punyani
Advisor

Again need help in scripting

Hi All,
I want to create a script which will send an email with the log attached to our client and I have created the same successfully as well.
Please find it attached.
It will first go to that directory.
It will then check the date so that it should take latest log.
Then it will check the content and send an email.
However The issue which I am facing is that this log is very lengthy. I want it to attach it in a notepad and then send it in an email.
Is it possible?
If yes how will I be doing that?
Please have a look at the script attached.

waiting for respone :)
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: Again need help in scripting

Shalom,

http://hpux.ws/mailfile2

Part of http://hpux.ws/

This script will email any attachment any email address.

Tested on
RHEL 5.x
HP-UX 11-11iv3

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Shikha Punyani
Advisor

Re: Again need help in scripting

Steven, Thanks a ton for your quick response.
I am beginner at scripting.
It seems you are a genius in reating scripts.
is there an easy wayto do it?
I just want to send a log file attached in a notepad.
Is there an easy way for it?
I just attached script which I have created.
Would you be so kind to have a look at it once?
any modifications to that script?
Dennis Handly
Acclaimed Contributor

Re: Again need help in scripting

>Would you be so kind to have a look at it once? any modifications to that script?

Your script just includes that log in the body of your message.
You need to glue SEP's script into your framework.
You might want to rename your file to temp.txt so that when you attach it, it has the right suffix. (And you may want to remove that temporary file after you mail it.)
James R. Ferguson
Acclaimed Contributor

Re: Again need help in scripting

Hi:

Dave La Mar posted a short series of tips for sending mail attachments in this thread:

http://h30499.www3.hp.com/t5/Messaging/mailx-send-an-email-with-a-file-attachment/m-p/3832040#M3301


Look at Dave's attachment therein.

Regards!

...JRF...

Shikha Punyani
Advisor

Re: Again need help in scripting

WOW....everytime I post a question, my queries get resolved here!
I have answers for everything now...
Thanks to all who have provided support in this regards.
and Please see my latest script which is working fine :)
Shikha Punyani
Advisor

Re: Again need help in scripting

Awesome Tips by David , explains everything !!!