Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tyring to send a file/message using mailx

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
GB
I have written a script that is run using crontab but when it finishes i need it to mail the results of the script to myself using mailx - how do i do this.

I want to do something like: -

if [ -r $HOME/`date +%a%d`.CHECK_OUT ]
then
mailx `date +%a%d`.CHECK_OUT "max.crook@telewest.co.uk"
fi

Where nnnnnnnnnnnn.CHECK_OUT is the log file

Any ideas ?
 
Try simply [tt]mailx &quot;user@domain.any&quot; [red]<[/red] /your/file&quot; [/tt] and nothing else....

I hope it works...
I hope it works...
Unix was made by and for smart people.
 
Yes that worked in the end I did this:

mail -sDebt_Age max.crook@telewest.co.uk < `date +%a%d`.DEBT_AGE

and it works ! Thanks for your help !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top