qpath='\/tmp\/foo\/bar' echo "$qpath" # it's crazy that all three of these produce the same result echo ${qpath//\\/} echo ${qpath//"`echo \\`"/} echo ${qpath//`echo "\\\\\\\\"`/}