bug-bash
[Top][All Lists]
Advanced

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

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


From: Martin Schulte
Subject: Possible problem with ${var%%[...]*}
Date: Sun, 2 Apr 2023 17:48:24 +0200

Hello,

in the following lines I consider dash's behaviour as correct an bash's as 
wrong:

$ uname -a
Linux martnix4 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 
GNU/Linux
$ bash        --version | head -n 1
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
$ bash-5.2.15 --version | head -n 1
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
$ bash        -c 'option2="test{<().["; echo "${option2%%[<().[]*}"'
test{<()
$ bash-5.2.15 -c 'option2="test{<().["; echo "${option2%%[<().[]*}"'
test{<()
$ dash        -c 'option2="test{<().["; echo "${option2%%[<().[]*}"'
test{

Am I missing something?

I tried to find a smaller example showing the difference but so far I didn't 
succeed.

Best regards,

Martin



reply via email to

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