Answers for "how to prevent bash or zsh from interpreting special characters"

1

how to prevent bash or zsh from interpreting special characters

# Short answer:
Escape the special characters with backslash e.g.:
echo This_is_a_wildcard_*
--> zsh: no matches found: This_is_a_wildcard_*
echo This_is_a_wildcard_\*
--> This_is_a_wildcard_*

# Using double quotes around the argument works as well, e.g.:
echo "This is a wildcard *"
--> This is a wildcard *

# Note, some of the special characters interpreted by bash/zsh include:
' " ! $ & [ ] ( ) ? *
Posted by: Guest on September-28-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language