Hi, 1.Linux 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:15 EDT 2008 x86_64 2.ksh 3.expr version:5.97
Also, 1. the exit status coming is 1552 and in some cases 51198.Also In my case,the $int_num will have only positive integers. So instead of checking exit status not equal to zero for alphanumeric char in the file.Shall we directly check the exit status -eq 1 or 2 or 3 for the field contain alphanumeric charecter. Also I dont think the error will not be solved if we use exit status -gt 1.Because the field is numeric but the exit status is strange(1552,51198)-these big numbers i think it is not part of the exit status as I expected ,as said before. same issue will come if we check exit status -gt 1.I want to avoid this strange issue(exit status 1552 is greater than 1) 2.Also please let me know this strange exit statues are showing os level problem or command expr level issue 3.Also, if we use add_num=`expr $int_num + 1 >/dev/null 2>&1` instead add_num=`expr $int_num + 1 1>/dev/null 2>&1` whether this issue can be resolved? 4.Also,if we use if [ $? -ne 0 ] instead of if [ "$?" -ne "0" ] whether this issue can be solved? Thanks, salih On Mon, Jan 11, 2010 at 1:50 PM, salih k <[email protected]> wrote: > Hi, > There is a bug iin the expr command and exit status is"51198" some times > "1552" > I have used expr to check whether the variable is numeric > add_num=`expr $int_num + 1 1>/dev/null 2>&1` > kms=$? > # if [ "$?" -ne "0" ] > if [ "$kms" -ne "0" ] > then > here $kms returns exit status other than zero even if $int_num is numeric > > > Please help > > Thanks, > Salih >
