[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:20:32 -0500 (EST)
User-agent: Alpine 2.00 (LMD 1167 2008-08-23)

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.

   3.1 is not an integer, nor is 3b.

   To do calculations with decimal fractions, I recommend awk.

   Chris F.A. Johnson                          <http://cfajohnson.com>
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
   Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)

reply via email to

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