我已经看到bash中很多使用单引号和双引号以及反引号引起来的用法,但是从未见过。以下记录的含义是什么,它似乎表明bash认为三重单引号是有意义的,并且进一步表明该内容中的单引号也具有特殊含义,可以进行插值?我没有找到任何文档。
$ Q=test
$ echo '$Q' # <== I know, this doesn't work...
$Q # <== ...and so it doesn't.
$ echo '''$Q''' # <== Don't know what this could mean.
$Q # <== OK, nothing special?
$ echo ''' "$Q" ''' # <== Try a double-quote??
"$Q" # <== Hmm... OK, nothing.
$ echo ''' '$Q' ''' # <== Try a single-quote?
test # <== Wow, it did interpolate!?
$ echo '''
> ''' # <== Continuation! Proving bash …Run Code Online (Sandbox Code Playgroud)