The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT]Bash Script help



On Thu, 5 Jun 2003, Dean Smith wrote:

> Could anyone supply me the line I need for a bash script to do this...
>
> If $VAL > %2 then
>
> $VAL is an integer between 0 and 100 as a string (captured from an
snmpget
> command) and %2 will be the value to test against supplied as the 2nd
> command line parameter.

Try this:

if [ $VAL -gt $2 ]; then
echo "Greater"
else
echo "Not greater"
fi

Or this:

X=`expr $VAL \> $2`

If $VAL is greater than $2, $X will be set to 1. If $VAL is not greater
than $2, $X will be set to 0.

Regards,

Kwong Li
li@xxxxxxx
Laser Business Systems Ltd.
http://www.laser.com



Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.