bug-bash
[Top][All Lists]
Advanced

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

bash tries to parse comsub in quoted PE pattern


From: Emanuele Torre
Subject: bash tries to parse comsub in quoted PE pattern
Date: Fri, 13 Oct 2023 18:08:00 +0200
User-agent: Mutt/2.2.12 (2023-09-09)

In a PE pattern, if the pattern has a single quoted part that contains
 $(  and does not contain a closing parenthesis, and has  \'  at the
end, bash will try to parse a command substitution and fail.

    $ echo "${HOME#'$('\'}"
    bash: command substitution: line 3: unexpected EOF while looking for 
matching `"'
    $ echo "${HOME#aaaa'$(aaaa'aaa)aaa\'}"
    bash: command substitution: line 5: unexpected EOF while looking for 
matching `"'
    $ echo "${HOME#aaaa'$(aaaa)'aaaa\'}"
    /home/emanuele6

I was able to reprodcue this bug in all versions starting from bash 4.3.

o/
 emanuele6



reply via email to

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