Re: ${var@A}; hypothetical, related parameter transformations
From:
Chet Ramey
Subject:
Re: ${var@A}; hypothetical, related parameter transformations
Date:
Wed, 20 Mar 2024 11:27:50 -0400
User-agent:
Mozilla Thunderbird
On 3/19/24 8:56 PM, Zachary Santer wrote:
So I can get a couple of the things I want by manipulating what I get out
of ${var@A} with fairly straightforward parameter expansions. If I needed a
declare command and wasn't sure if I would get one, I haven't found a way
to expand that to something that is guaranteed to be a declare command
maintaining attribute settings. I think you're stuck using an if block at
that point.
That expansion will produce a declare command if the variable has any
attributes, since it needs one to reproduce them. If the variable has a
value, but no attributes, you'll get an assignment statement. If there
are no attributes and no value, you get nothing.
--
``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/