On 8/26/25 6:40 PM, Zachary Santer wrote:
On Tue, Aug 26, 2025 at 3:44 PM Chet Ramey <chet.ra...@case.edu> wrote:

The case toggling word expansions are rather famously undocumented. I don't
like the syntax and I don't encourage its use. Those operators are still
there to support scripts that use them.

I wondered why ${parameter@U}, ${parameter@u}, and ${parameter@L} were
introduced.

I think that's a more general framework to add features like this. I just
hadn't adopted it from mksh when I added the case modification expansions
in bash-4.0. That was 2009, I don't think Thorsten had even added them yet.

Do you not like the syntax of ${parameter^^},
${parameter^}. and ${paramter,,}, either?

They're ok, but it gets harder and harder to find unused special characters
to use for such word expansions. The advantage of using those forms is that
you can specify a pattern to limit the characters that are modified. But
how often do you need that generality? For most cases, the @U and @L
transformations are sufficient.


Not that I've ever had a use
for a case-toggling word expansion, but there's no alternative that's
documented, aside from calling an external command.

You've never found a use for one, but bash should provide one because
there's no documented alternative?

--
``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/

Reply via email to