[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is it really necessary to allow operators and whole right hand sides
From: |
Chet Ramey |
Subject: |
Re: Is it really necessary to allow operators and whole right hand sides to be substituted in (())? |
Date: |
Mon, 17 May 2021 19:22:40 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 |
On 5/17/21 6:11 PM, Dennis Williamson wrote:
You do know there's more to it than that - substitutions are chained, too,
right?
If you have variables (or tokens that look like variables) without the
leading `$', the value is treated as an expression and evaluated
accordingly.
a=4
b=a
c=b
((d = c * 2))
echo "$d" # output: 8
`let' and $((...)) work the same way.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/