On 7/9/25 2:00 PM, Greg Wooledge wrote:
On Wed, Jul 09, 2025 at 11:36:59 -0400, Chet Ramey wrote:
The arithmetic expression within (( and )) is equivalent to
let "expression"
so the contents are expanded once as if in double quotes. This has
always been the case -- earlier versions of bash just translated
((expr)) into let "expr" internally, and the documentation was explicit
about the equivalence.
If that's true, then I don't understand why these two commands give
different results:
The behavior started to diverge when I started making the changes discussed
back in https://lists.gnu.org/archive/html/bug-bash/2021-03/msg00056.html.
That's when I removed the sentence from the man page. But the point stands:
the expression is expanded as if it were in double quotes before the
expression evaluator is called. The internal quoting I discussed isn't
applied to `let', since builtins have different rules than compound
commands.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/