OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
A quick question about scripting

From: Tomas (wishermyliu.m-1.lt)
Date: Thu Sep 02 2004 - 08:58:04 CDT


I know you all know better ways to do this :) but this is my first UNIX
script, so please don't laught :)

Here's my script:

<----->

#!/bin/sh

#

sendmail -bd && cd /var/log/ && gunzip maillog.6.gz && more maillog.6 | mail
-s Test mymail \

.lt && rm maillog.6 && kill -HUP `head -n 1 /var/run/sendmail.pid`

<----->

Everything works fine, but I don't get my mail because sendmail doesn't make
it in time to send mail before it gets killed ( if I don't kill sendmail, I
get my mail )

So I have two questions about this script:

Is there a way to make my script to sleep for a short time?

Is there a way to atach maillog.6.gz file to a mail and send it gziped?