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).
Posted Aug 7, 2009 20:34 UTC (Fri) by branden (subscriber, #7029)
[Link]
It depends on which kind of shell arithmetic you're talking about.
The article's author may have been thinking of:
bash$ if (( 2 + 2 )); then echo yes; fi
yes
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 ))
4
Which *is* SUSv3.
shell arithmetic is not a "bashism"
Posted Sep 4, 2009 10:32 UTC (Fri) by vapier (subscriber, #15768)
[Link]
really you just backed up my point. while bash does have arithmetical extensions, the phrase used in the article is wrong. you cant lump "shell arithmetic" in with "let", "source", and "echo -e".