[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: expr exit status

From: salih k
Subject: Re: expr exit status
Date: Wed, 20 Jan 2010 21:57:13 +0800

On Wed, Jan 20, 2010 at 9:11 PM, Eric Blake <address@hidden> 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 check the same
> >
> > If you are on a Linux system, then 'strace expr $int_num + 1' will give
> > you a (very verbose) dump of every system call, including which value
> > exit() was called with.  In all likelihood, it will have been exit(0), in
> > which case, if $? is corrupted, it is a bug in your shell and not in
> expr.
> Another thing to try would be running your script under 'sh -vx script',
> to get output of exactly what the shell is evaluating at the time.  In
> fact, that might be easier to use than strace.  But whatever you do, trim
> traces down to the relevant portion, rather than sending large logs to the
> list.  And please consider attaching (not pasting inline) unmangled (and
> not post-edited) source and output; your insistence on inserting * inside
> snippets is making it hard to determine where your snippets start and end,
> and draws into suspicion whether you are making a mistake where the script
> ran something different than what your email shows.
> --
> Don't work too hard, make some time for fun as well!
> Eric Blake             address@hidden
Hi ,
I am not sure when the issue will happen again(so debugger not much useful
now as the issue not coinsistant) but the fix is required now.What are the
output obtained during last run that I already explained.

As you confirmed the exit status of expr can be 0,1,2,3 and >3 in expr
version:5.97,even if the i ma using the expr only for  a alphanumeric
check.So ibelive i have to go ahead with case statement(it will be a tough
time) and i belive then the linux mannual for expr need to b e modified as
it explains exit status only 0,1,2,3

Please let me know whether i have to attach the script(i am not attaching as
it may be repeating)
Is there any way to check the old traces.Because it happen on jan7


reply via email to

[Prev in Thread] Current Thread [Next in Thread]