$ echo $hello
Just like in any Korn-like shell. Or POSIXly:
$ : "$(($name += 1))"
$ echo "$hello"
The point is that all parameter expansion, command substitutions and arithmetic expansions are done inside arithmetic expressions prior to the arithmetic expression being evaluated.
is similar to
let "$name++"), that's first expanded to
hello++ and that's evaluated as the
++ operator applied to the
sh has no
((...)) operator but it has the
$((...)) arithmetic expansion operator. It doesn't have
++ (though it allows implementations to have one as an extension instead of requiring it to be a combination of unary and/or binary
+ operators), but it has
: "$((...))" where
: is the null command, we get something similar to ksh's
((...)). Though a strict equivalent would be
[ "$((...))" -ne 0 ], as
((expression)) returns false when the expression resolves to 0.