Fix "grep: warning: stray \ before -" in conda.bash (#2768)

According to the POSIX spec, an unescaped backslash not followed by
an escapable character is undefined behavior,
and it has become an error in GNU grep 3.8 (2022-09-02).
This commit is contained in:
Alex Hedges 2023-08-28 16:57:04 -04:00 committed by GitHub
parent 7ec5c30451
commit e1b7e1b519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ make_shims() {
deregister_conda_shims() {
# adapted for Bash 4.x's associative array (#1749)
if declare -p registered_shims 2> /dev/null | grep -Eq '^(declare|typeset) \-A'; then
if declare -p registered_shims 2> /dev/null | grep -Eq '^(declare|typeset) -A'; then
for shim in ${!registered_shims[*]}; do
if conda_shim "${shim}" 1>&2; then
unset registered_shims[${shim}]