Trying to escape something that has no special meaning when escaped. The backslash will simply be ignored here.
If the backslash was supposed to be literal, it is recommended to enclose it in a single quote or escape it.
If you wanted it to expand to something, rewrite the expression to use printf
(or in bash, $'\t'
).
Problematic code:
# Want literal backslash
echo Yay \o/
# Want other characters
bell=\
Correct code:
echo 'Yay \o/'
bell="$(printf '\a')