It's very important to test :
input="a\b\c\d" echo ${input} echo "${input/\\//}" echo "${input//\\//}"