bug-bash
[Top][All Lists]
Advanced

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

Re: Possible problem with ${var%%[...]*}


From: Greg Wooledge
Subject: Re: Possible problem with ${var%%[...]*}
Date: Sun, 2 Apr 2023 13:54:55 -0400

On Mon, Apr 03, 2023 at 12:28:25AM +0700, Robert Elz wrote:
> bash is parsing the <() as a process substitution, producing nothing.
> The only chars in the bracket expression will then be . and [ which
> explains the result.

That does seem like a bug, to be fair.

> Try instead
> 
>       bash        -c 'option2="test{<().["; echo "${option2%%[\<().[]*}"'
> 
> and you'll see the difference.   That form should work for all shells.

Or move the < to a different position.



reply via email to

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