SCIENTIFIC-LINUX-USERS Archives

July 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Manuel Mussini <[log in to unmask]>
Reply To:
Manuel Mussini <[log in to unmask]>
Date:
Sat, 14 Jul 2007 09:04:03 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
Hi,
this is really useful!!!!!
Could you help me a little more to understand the syntax?
It's not clear to me what "cat <<Z" and "Z" do!

In addition to that ... what do I need to configure to let this work? I'm
not able to run it on all my desktops so probably something is set
different! I get no error but I do not receive the mail!

Thanks!!

Bye...


> -----Original Message-----
> From: [log in to unmask] [mailto:owner-
> [log in to unmask]] On Behalf Of John Summerfield
> Sent: Friday, July 13, 2007 00:30
> To: [log in to unmask]
> Subject: Re: Mail from a script
> 
> Manuel Mussini wrote:
> > Hi,
> >
> > is there a way to send an email from a bash script?
> >
> > I mean . I have a script that manages some jobs that need many days to
> > complete (they run locally on my desktop!)! I'd like to receive some
> emails
> > containing the status of the job! Just like CAF's endjob mails!
> >
> > Is it possible?
> 
> This doesn't give any control over the from: field; it's simply piped
> into sendmail. It mirrors what crond and atd do.
> 
> echo -e 'Love\n\tMaria' \
> 	| mail -s "Message for Manuel" [log in to unmask]
> 
> The following gives complete flexibility and is what I often do to send
> reports. Note that I have two sections here, one sending out the headers
> (including the needed blank line), one creating the actual report. This
> mirrors what is often needed in practice.
> 
> (
> cat <<Z
> To: [log in to unmask]
> From: [log in to unmask]
> Subject: Message from Maria
> 
> Z
> echo Thanks so much for last night
> echo
> echo Love
> echo -e \ Maria
> ) 2>&1 \
>   | /usr/sbin/sendmail -t
> 
> 
> 
> --
> 
> Cheers
> John
> 
> -- spambait
> [log in to unmask]  [log in to unmask]
> 
> Please do not reply off-list

ATOM RSS1 RSS2