expr exit status

2010-01-20 Thread salih k
Hi, add_num=`expr $int_num + 1 1/dev/null 21` if [ $? -ne 0 ] 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 so, i am planning to use kms=$? if [ $kms -eq 1 -o $kms -eq 2 -o $kms -eq 3 ] instaed

Re: expr exit status

2010-01-20 Thread Philip Rowlands
On Wed, 20 Jan 2010, salih k wrote: add_num=`expr $int_num + 1 1/dev/null 21` if [ $? -ne 0 ] some case exit status is 1552 for expr even though the argument is integer This cannot be true, as the exit status exposed through the $? shell variable is limited to the range 0-255. For

Re: expr exit status

2010-01-20 Thread salih k
On Wed, Jan 20, 2010 at 7:33 PM, Philip Rowlands p...@doc.ic.ac.uk wrote: On Wed, 20 Jan 2010, salih k wrote: add_num=`expr $int_num + 1 1/dev/null 21` if [ $? -ne 0 ] some case exit status is 1552 for expr even though the argument is integer This cannot be true, as the exit

Re: expr exit status

2010-01-20 Thread Philip Rowlands
On Wed, 20 Jan 2010, salih k wrote: Now shall I explain again (sorry:)) actually the issue is rare and never happened in unix .So am curious on this. never happened in unix? Which OS and shell are you using? Now my query is why these exit status (254 or 16) are coming during the first run

Re: expr exit status

2010-01-20 Thread salih k
On Wed, Jan 20, 2010 at 8:29 PM, Philip Rowlands p...@doc.ic.ac.uk wrote: On Wed, 20 Jan 2010, salih k wrote: Now shall I explain again (sorry:)) actually the issue is rare and never happened in unix .So am curious on this. never happened in unix? Which OS and shell are you using?

Re: expr exit status

2010-01-20 Thread Eric Blake
According to salih k on 1/20/2010 5:55 AM: Hi, Well ,I have three queries now, [please trim your replies down to relevant portions you are replying to - we don't need to read the same text over and over again] 1.I am waiting for answer whether I can use if [ $?

Re: expr exit status

2010-01-20 Thread Eric Blake
According to Eric Blake on 1/20/2010 6:01 AM: 3.As you suggested(thanks)check what arguments for exit() expr is giving =Frankly i dont know how to check the same I will be thankful if you please let me know the way to check the same If you are on a Linux system, then 'strace expr $int_num +

Re: expr exit status

2010-01-20 Thread salih k
On Wed, Jan 20, 2010 at 9:11 PM, Eric Blake e...@byu.net wrote: According to Eric Blake on 1/20/2010 6:01 AM: 3.As you suggested(thanks)check what arguments for exit() expr is giving =Frankly i dont know how to check the same I will be thankful if you please let me know the way to

Re: expr exit status

2010-01-19 Thread Alfred M. Szmidt
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.

Re: expr exit status

2010-01-19 Thread salih k
On Tue, Jan 19, 2010 at 3:37 PM, Alfred M. Szmidt a...@gnu.org 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

expr exit status

2010-01-18 Thread salih k
Hi, 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 Thanks Regards Salih

Re: expr exit status

2010-01-18 Thread Mike Frysinger
On Tuesday 19 January 2010 02:11:14 salih k 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 ? please read the documentation -- `man expr` -mike signature.asc Description: This is a