how to mail from unix shell script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priyankapendkar
    New Member
    • Apr 2011
    • 9

    how to mail from unix shell script?

    Hi,


    #! /bin/bash
    x=50
    if [ $x -gt 25 ]
    then
    mail -s "$x is greater than 25" email@address
    fi


    i have run this command on unix shell script...
    their is no error but i am not getting the mail
    can anybody tell me what may be the reason??
    Last edited by sicarie; Apr 18 '11, 03:10 PM. Reason: removing email address from post
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    What happens when you run

    mail -s "$x is greater than 25" email@address

    without the rest of the script? Do you get an error? Do you get mail? Is the mailserver installed and all processes started?

    Comment

    Working...