Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
dash has had a history of not supporting all of POSIX's math requirements (like `v=1; echo $((v))`), but that should be fixed now (if not by dash, then by distros).
shell arithmetic is not a "bashism"
Posted Aug 7, 2009 20:34 UTC (Fri) by branden (subscriber, #7029)
The article's author may have been thinking of:
bash$ if (( 2 + 2 )); then echo yes; fi
ash$ if (( 2 + 2 )); then echo yes; fi
ash: 2: not found
As the bash manpage notes, "This is exactly equivalent to let "expression"."
"let" isn't SUSv3, so (( )) isn't either.
You are probably thinking of:
$ echo $(( 2 + 2 ))
Which *is* SUSv3.
Posted Sep 4, 2009 10:32 UTC (Fri) by vapier (subscriber, #15768)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds