[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: expr say "non integer argument"
From: |
Chris F.A. Johnson |
Subject: |
Re: expr say "non integer argument" |
Date: |
Thu, 18 Feb 2010 08:57:38 -0500 (EST) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Thu, 18 Feb 2010, Eric Blake wrote:
> According to Chris F.A. Johnson on 2/18/2010 6:20 AM:
> > On Thu, 18 Feb 2010, address@hidden wrote:
> >
> >> $ expr 3.1 + 3
> >> expr: non-numeric argument <---say "non integer argument"
> >> $ expr 3.1 + 3b
> >> expr: non-numeric argument
> >
> > The expr command's arithmetic only works with integers.
>
> But that's not his point. The point is that 3.1 is numeric, so the error
> could be fine-tuned to state that expr expects integers to make it clear
> that numeric but non-integer is the reason for the failure.
My apologies; I should have read it more closely. That'll teach me
to post early in the morning!
> And I'm inclined to agree. I see nothing in POSIX that requires the
> current error string, or forbids a more specific error string.
I agree.
--
Chris F.A. Johnson <http://cfajohnson.com>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
- Re: expr say "non integer argument", (continued)
- RE: expr say "non integer argument", Voelker, Bernhard, 2010/02/18
- Re: expr say "non integer argument", Eric Blake, 2010/02/18
- RE: expr say "non integer argument", Voelker, Bernhard, 2010/02/19
- Re: expr say "non integer argument", Jim Meyering, 2010/02/19
- Re: expr say "non integer argument", Eric Blake, 2010/02/25
- Re: expr say "non integer argument", Eric Blake, 2010/02/25
- Re: expr say "non integer argument",
Chris F.A. Johnson <=
- Re: expr say "non integer argument", jidanni, 2010/02/18