[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: sending the output of a script through mail

On Thu, 2006-09-21 at 11:25 +0530, ankush grover wrote:
>  I have written a script which shows the local and lan address of a system.
> #!/bin/sh
> test= ifconfig -a | grep addr: | awk '{print $2}'
> I want to send the output of this command to a user through mail. How
> can I achieven this ?

Hmm, well that looks like you can work most things out for yourself, see
if these hints lets you work out the rest:  

Have a look at the "mail" command, and add a bit more to the line in
your script, using it.  

You may have to also configure sendmail so that locally generated mail
goes out with a real internet domain name (i.e. you're unlikely be able
to send out an e-mail from root localhost, for instance).  I think
that's a "masquerading" option, just going from memory.  But you might
want to look at the sendmail website, for more help with configuring
sendmail than the docs that come with Fedora.

(Currently running FC4, occasionally trying FC5.)

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]