A RHS regular expression should always be unquoted (since Bash 3.2 at least)
”Except that you do need double quotes where a pattern or regular expression is expected: on the right-hand side of =
or ==
or !=
or =~
.” Perhaps I’m misunderstanding this, but AFAIK, a RHS regular expression (i.e. after =~
) should always be unquoted (since Bash 3.2 at least).