${name:q}: Quote words

Escapes special characters of the variable value.

Use :x if you’d like to break into words at whitespace. Please note that :x does not work with parameter expansion.

Examples

Quote variable value
1
2
code="echo Pattern is *.txt"
echo $code:q
Output:
1
echo\ Pattern\ is\ \*.txt
BashSupport Pro 是一款支持 q** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款