[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
|