这不是
ssh
或
awk
处理引号时,它就是shell(而且它们必须防止shell处理其他字符,特别是
$
)。不支持嵌套它们(尽管其他结构,如
$()
甚至在包含引号时也可以嵌套),因此需要分别转义单引号。以下是几种方法:
$ echo 'Don'"'"'t mess with this apostrophe!'
Don't mess with this apostrophe!
$ echo 'Don'\''t mess with this apostrophe!'
Don't mess with this apostrophe!