On Tue, Jan 19, 2010 at 3:37 PM, Alfred M. Szmidt <[email protected]> wrote:

>   What are all the exit statuses I need to check just after expr
>   command?  Is it only need to check 1 or 2 or 3 for fail condition
>   and zero for success ?else pease specify
>
> You only need to check for non-zero exit codes for failure.
>
---
Hi,
But some case exit status is 1552 for expr even though the argument is
integer .Initialy i checked
if [ $?-ne 0 ],but this shows the above error that why i am planning to use
kms=$?
if [ $kms -eq 1 -o $kms -eq 2 -o $kms -eq 3 ]
instaed of
if [ "$kms" -ne "0" ] is it fine or will it make issues.
 The mannual says
info expr|more
    Exit status:
      0 if the expression is neither null nor 0,
      1 if the expression is null or 0,
      2 if the expression is syntactically invalid,
      3 if an error occurred.
Regards,
Salih

Reply via email to