On 10/31/22 1:31 AM, Hyunho Cho wrote:

# this is an error
# [[ ]] command recognizes ">(.*)" as process substitution.
bash$ [[ $val =~ ((.*)<[^>]*>(.*)) ]] && echo yes      # Error !
bash$ .*: command not found

Yes, process substitution is one of the word expansions the pattern
undergoes (all words between [[ and ]] undergo the same set of word
expansions).

################  The Second problem  #################

This only happens in the terminal.

# 1. intentionally makes an error by removing escape "\>" to ">"
bash$ [[ $val =~ (.*)\ \<[^\>]*>\ (.*) ]] && echo yes
bash: syntax error in conditional expression: unexpected token `>'

# 2. fixed the error with \> escape, but the error continues
bash$ [[ $val =~ (.*)\ \<[^\>]*\>\ (.*) ]] && echo yes
bash: syntax error near unexpected token `$val'

This has already been fixed, the result of

https://savannah.gnu.org/support/index.php?110745



# 3. On the second try, the error goes away.
bash$ [[ $val =~ (.*)\ \<[^\>]*\>\ (.*) ]] && echo yes
yes

################  The third problem  #################

This also happens only in the terminal.
but very unexpectedly happens

I can't reproduce this using bash-5.2.2.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to