Bash Pattern Substitution behaves differently in Bash 4.2 and Bash 5.0.
While [1] outputs 'a/b' in Bash 5.0, it outputs a\/b for Bash 4.2.
This leads to several errors in the latter environment, including errors
for [2].
Since the part of the pattern substitution after the second slash are
treated as strings by bash, let's avoid escaping the slash in those
paths.
[1] foo='a:b'; echo "${foo/:/\/}"
[2] test -f $PATH_AFTER_PATTERN_SUBSTITUTION
Bash Pattern Substitution behaves differently in Bash 4.2 and Bash 5.0. While [1] outputs 'a/b' in Bash 5.0, it outputs
a\/b
for Bash 4.2. This leads to several errors in the latter environment, including errors for [2].Since the part of the pattern substitution after the second slash are treated as strings by bash, let's avoid escaping the slash in those paths.
[1] foo='a:b'; echo "${foo/:/\/}" [2] test -f $PATH_AFTER_PATTERN_SUBSTITUTION
Signed-off-by: Athos Ribeiro athos@redhat.com