[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: status on $[arith] for eval arith vsl $((arith))??
From: |
Chris F.A. Johnson |
Subject: |
Re: status on $[arith] for eval arith vsl $((arith))?? |
Date: |
Sun, 8 Apr 2012 15:11:45 -0400 (EDT) |
User-agent: |
Alpine 2.00 (LMD 1167 2008-08-23) |
On Sat, 7 Apr 2012, Linda Walsh wrote:
In modifying some released code on my distro, I ran into the extensive use
of $[arith] as a means for returning arithmetic evaluations of the
expression.
I vaguely remember something like that from years ago, but never see any
reference to
it -- yet it works, and old code seems to rely on it -- and
"$[(1+2)/3]" looks cleaner than "$(((1+2)/3))". So what's up with that?
At the minor expense of a few extra keystrokes, $(( (1+2) / 3 ))
looks just as clean, and has the added cachet of being portable.
--
Chris F.A. Johnson, <http://cfajohnson.com/>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
- Re: status on $[arith] for eval arith vsl $((arith))??, (continued)
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Elliott Forney, 2012/04/10
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/10
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/11
- Re: status on $[arith] for eval arith vsl $((arith))??, Greg Wooledge, 2012/04/11
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/12
- Re: status on $[arith] for eval arith vsl $((arith))??, Andreas Schwab, 2012/04/12
Re: status on $[arith] for eval arith vsl $((arith))??,
Chris F.A. Johnson <=