mail script

This is a discussion on mail script within the Linux General forums, part of the Linux Forums category; Hi Can someone help me with a simple email script? I want to execute it from the termainal. Something like ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-30-2003
Christopher
 
Posts: n/a
Default mail script

Hi

Can someone help me with a simple email script?

I want to execute it from the termainal.

Something like this..

I run IFCONFIG > (redirect results to file) then email it.

I have evolution setup for emailing. Do I need to setup some files
some where or can I use a terminal command?

And I guess I need some advice on a scripting language. Whatever is
standard wit Redhat 9.
Any advice is helpful.
Thanks
Reply With Quote
  #2 (permalink)  
Old 06-30-2003
mjt
 
Posts: n/a
Default Re: mail script

Christopher wrote:

> I want to execute it from the termainal.
>
> Something like this..
>
> I run IFCONFIG > (redirect results to file) then email it.


..... in two words, "man mail" ... you can do it from the CLI
..
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Michael J. Tobler: motorcyclist, surfer, # Black holes result
skydiver, and author: "Inside Linux", # when God divides the
"C++ HowTo", "C++ Unleashed" # universe by zero

Reply With Quote
  #3 (permalink)  
Old 06-30-2003
jbuchana@buchanan1.net
 
Posts: n/a
Default Re: mail script

Christopher <blackpack3000@yahoo.com> wrote:
> Can someone help me with a simple email script?


> I want to execute it from the termainal.


> Something like this..


> I run IFCONFIG > (redirect results to file) then email it.



#!/bin/bash

email_address="you@you.org"
subject="ifconfig results"

PATH=/bin:/usr/bin:/sbin:/usr/sbin

ifconfig | mail -s $subject $email_address


> And I guess I need some advice on a scripting language. Whatever is
> standard wit Redhat 9.


Well, for something as simple as the above, I used bash. But for
serious scripting, I almost always choose perl. "The swiss army
chainsaw" of scripting languages.

Do a Google search on perl, you'll find a lot of good resources.

--
Jim Buchanan jbuchana@kokomo1.net jbuchana@buchanan1.net
=================== http://www.buchanan1.net/ ==========================
"We already have a zillion minimalistic languages. CS departments are
full of 'em. Sometimes you have to go around stomping the little
beggars just to keep their population in check." -Larry Wall
================= Visit: http://www.thehungersite.com ==================
Reply With Quote
  #4 (permalink)  
Old 06-30-2003
mjt
 
Posts: n/a
Default Re: mail script

jbuchana@buchanan1.net wrote:

> I almost always choose perl. "The swiss army
> chainsaw" of scripting languages.


..... BWA HAHAHAHAHHAHAHAHHAHAHA. good one :)
..
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Michael J. Tobler: motorcyclist, surfer, # Black holes result
skydiver, and author: "Inside Linux", # when God divides the
"C++ HowTo", "C++ Unleashed" # universe by zero

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:09 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0