SUMMARY:Shell Querry

From: AK Rasanth (akrasanth@velankani.com)
Date: Thu Jul 04 2002 - 09:38:08 EDT


Hi all,
my querry was -

> When I do the following in bash
> if [ $DB_SIZE -gt $ALLOC_SIZE75 ]
> then
> do something
> else
> do something else
> fi
> it gives me the correct answer ($DB_SIZE is less than $ALLOC_SIZE75)
>
> but in ksh , it gives me just the reverse . can anybody tell me why this
> happens?

ksh -x myscript.sh
DB_SIZE=6176768
ALLOC_SIZE75=8053063676
+ [ 6176768 -gt 8053063676 ]
+ echo do something
do something

bash -x myscript.sh
DB_SIZE=6176768
ALLOC_SIZE75=8053063676
+ '[' 6176768 -gt 8053063676 ']'
+ echo ' do something else'
do something else

Thanks to Thomas who gave me the correct answer .
the problem is , in ksh , variable cannot hold such huge value by default .
but bash can .

Thanks&Regards,
A.K.Rasanth
ph: 91-80-8522507 Ext 1626

--------------------------------------------------------------
Velankani Information Systems Ltd, Bangalore, India
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:33 EDT