Is there any comprehensive list of characters that need to be escaped in Bash? Can it be checked just with sed
?
In particular, I was checking whether %
needs to be escaped or not. I tried
echo "h%h" | sed 's/%/i/g'
and worked fine, without escaping %
. Does it mean %
does not need to be escaped? Was this a good way to check the necessity?
And more general: are they the same characters to escape in shell
and bash
?
I noticed that bash automatically escapes some characters when using auto-complete.
For example, if you have a directory named
dir:A
, bash will auto-complete todir\:A
Using this, I runned some experiments using characters of the ASCII table and derived the following lists:
Characters that bash escapes on auto-complete: (includes space)
Characters that bash does not escape:
(I excluded
/
, as it cannot be used in directory names)