Link to home
Start Free TrialLog in
Avatar of Anthony Key
Anthony KeyFlag for United States of America

asked on

Simple Mailx script

Hi I'm looking for a very simple 2 - 3 line mailx script to send a one line message to my email address. I need this to test setting up some jobs in a scheduler program.
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

If you are going to use it in crontab:

0 3 * * * /pat/to/myscript 2> &1 | mailx -s "script results" me@mydomain
Hi,

I am repeating since there shouldn't be a space

0 3 * * * /pat/to/myscript 2>&1 | mailx -s "script results" me@mydomain
Avatar of Anthony Key

ASKER

Thanks yuzh, in addition I had to change some permissions but it ran perfectly in Contol -M.

Thanks,
7Souls