我需要将"写入字符串,因为脚本需要格式化,但我不知道该怎么做。
"
是否需要将其标记为角色?
你需要加倍它,把它放在一个单引号内或用`转义它
`
echo "This will output a double quote """ echo '"This will also be put in double quotes"' echo "`"This is another way to quote`""
有关更多字符串引用的基础知识,请参阅official documentation