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.