help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $${a,b} brace expansion flaw.


From: Lawrence Velázquez
Subject: Re: $${a,b} brace expansion flaw.
Date: Sat, 20 Jan 2024 03:18:52 -0500
User-agent: Cyrus-JMAP/3.9.0-alpha0-1374-gc37f3abe3d-fm-20240102.001-gc37f3abe

On Sat, Jan 20, 2024, at 2:43 AM, Kaz Kylheku wrote:
> Someone just posted this finding on Stackoverflow:
>
> https://stackoverflow.com/questions/77850130/bash-parse-of-x-y
>
> When brace expansion is adjacent to $$, it doesn't expand.
>
> Try
>
>    echo $${a,b}
>    echo $$-{a,b}
>
> Documented somewhere? Or bug?

The manual says:

        To avoid conflicts with parameter expansion, the string
        `${' is not considered eligible for brace expansion, and
        inhibits brace expansion until the closing `}'.

https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html

-- 
vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]