Operating System - Linux
1751843 Members
5532 Online
108782 Solutions
New Discussion юеВ

Emailing user on script completion

 
SOLVED
Go to solution
Alex Rauket
Occasional Contributor

Emailing user on script completion

Hello,

I have been programming a FORTRAN program that, when complete, will take many days to execute.

I am looking for a UNIX system command that I can call in order to email the user on completion. I would like it to be a single line command, as these are simple to program into FORTRAN.

I am faily new to the UNIX environment but I have used program sthat do this, so I know it's possible.

Thanks for all your help.
3 REPLIES 3
Darrel Louis
Honored Contributor

Re: Emailing user on script completion

Hi,

I'm not a programmer and don't know Fortran at all.
Is the program started from a scheduler (like cron) or is it called within a shell-script.

Within unix you can use mailx, to sent a mail.

Darrel
Sandman!
Honored Contributor

Re: Emailing user on script completion

Alex...take a look at the "system" command under FORTRAN. That's probably what you are looking for. Something like...

value=system("mailx -s subject mailaddress")

enjoy!
Jakes Louw
Trusted Contributor
Solution

Re: Emailing user on script completion

In HP-UX, it's very simple:

echo $MESSAGE_STRING | mailx -s Subject me@mydomain

So if you can firstly build the string in FORTRAN, then execute the UNIX commannd line, you're away.
Trying is the first step to failure - Homer Simpson