FAQ
Hello.

I am trying to enhance a shell script in bash shell on HP UX. I need your
help, please. I need the script to mail me if the value of a variable is
more than certain number. How can I do this? $free is the variable

If $free > 500
mailx -s "Value of free is :" the _value_of_free shivaswamykr_at_abc.com
fi

is what I want to do .

Can you tell me how I can do this.

Thanks for your help,
Shiva

Search Discussions

  • Reidy, Ron at Apr 18, 2007 at 10:18 pm
    http://tldp.org/LDP/abs/html/testconstructs.html





    From: oracle-l-bounce_at_freelists.org
    On Behalf Of Shivaswamy Raghunath
    Sent: Wednesday, April 18, 2007 2:49 PM
    To: Oracle-L Freelists
    Subject: Slightly Off Topic - value of variable in unix mail



    Hello.



    I am trying to enhance a shell script in bash shell on HP UX. I need
    your help, please. I need the script to mail me if the value of a
    variable is more than certain number. How can I do this? $free is the
    variable



    If $free > 500

    mailx -s "Value of free is :" the _value_of_free shivaswamykr_at_abc.com

    fi



    is what I want to do .



    Can you tell me how I can do this.



    Thanks for your help,

    Shiva



    This electronic message transmission is a PRIVATE communication which contains
    information which may be confidential or privileged. The information is intended
    to be for the use of the individual or entity named above. If you are not the
    intended recipient, please be aware that any disclosure, copying, distribution
    or use of the contents of this information is prohibited. Please notify the
    sender of the delivery error by replying to this message, or notify us by
    telephone (877-633-2436, ext. 0), and then delete it from your system.
  • Carel-Jan Engel at Apr 18, 2007 at 10:24 pm
    Shiva,

    First of all: before you read my answer, read Jareds post of yesterday:

    http://www.freelists.org/archives/oracle-l/04-2007/msg00662.html

    The rest of the answer is a couple of newlines below. Please read the
    link above first.

    Then, I'm in a good mood today. So I decided to help you a little and
    keyed in these words in Googles search engine:

    bash condition greater

    Guess what the second hit was:
    http://linuxhelp.blogspot.com/2005/10/10-seconds-guide-to-bash-shell.html

    Maybe you're able to exploit this easy problem solving tactic next time.

    Best regards,

    Carel-Jan Engel

    ===
    If you think education is expensive, try ignorance. (Derek Bok)
    ===
    On Wed, 2007-04-18 at 16:48 -0400, Shivaswamy Raghunath wrote:
    Hello.

    I am trying to enhance a shell script in bash shell on HP UX. I need
    your help, please. I need the script to mail me if the value of a
    variable is more than certain number. How can I do this? $free is the
    variable

    If $free > 500
    mailx -s "Value of free is :" the _value_of_free
    shivaswamykr_at_abc.com
    fi

    is what I want to do .

    Can you tell me how I can do this.

    Thanks for your help,
    Shiva
    --
    http://www.freelists.org/webpage/oracle-l
  • GovindanK at Apr 19, 2007 at 12:34 am
    $ free=45
    $ if test $free -ge 45
    then
    echo greater
    else
    echo not greater
    fi
    greater

    hth

    GovindanK
    On Wed, 18 Apr 2007 16:48:52 -0400, "Shivaswamy Raghunath" said:

    Hello.

    I am trying to enhance a shell script in bash shell on HP UX. I need your help, please. I need the script to mail me if the value of a variable is more than certain number. How can I do this? $free is the variable

    If $free > 500

    mailx -s "Value of free is :" the _value_of_free [1]shivaswamykr_at_abc.com

    fi

    is what I want to do .

    Can you tell me how I can do this.

    Thanks for your help,

    Shiva

    References

    mailto:shivaswamykr_at_abc.com
  • GovindanK at Apr 19, 2007 at 12:41 am
    $ man if will give you more.

    hth

    GovindanK
    On Wed, 18 Apr 2007 16:48:52 -0400, "Shivaswamy Raghunath" said:

    Hello.

    I am trying to enhance a shell script in bash shell on HP UX. I need your help, please. I need the script to mail me if the value of a variable is more than certain number. How can I do this? $free is the variable

    If $free > 500

    mailx -s "Value of free is :" the _value_of_free [1]shivaswamykr_at_abc.com

    fi

    is what I want to do .

    Can you tell me how I can do this.

    Thanks for your help,

    Shiva

    References

    mailto:shivaswamykr_at_abc.com
  • Shivaswamy Raghunath at Apr 19, 2007 at 12:59 am
    Thanks Robert and everybody.
    On 4/18/07, GovindanK wrote:

    $ man if will give you more.

    hth

    GovindanK

    On Wed, 18 Apr 2007 16:48:52 -0400, "Shivaswamy Raghunath" said:

    Hello.

    I am trying to enhance a shell script in bash shell on HP UX. I need your
    help, please. I need the script to mail me if the value of a variable is
    more than certain number. How can I do this? $free is the variable

    If $free > 500
    mailx -s "Value of free is :" the _value_of_free shivaswamykr_at_abc.com
    fi

    is what I want to do .

    Can you tell me how I can do this.

    Thanks for your help,
    Shiva

    --
    http://www.freelists.org/webpage/oracle-l

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedApr 18, '07 at 8:48p
activeApr 19, '07 at 12:59a
posts6
users4
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase