上QQ阅读APP看书,第一时间看更新
Quote concatenation
You may have noticed from the examples in the previous section that you can put different types of quoting together in the same word, as long as they can never separated by an unquoted space:
$ echo Hello,\ "$USER"'! Welcome to '"$HOSTNAME"'!' Hello, bashuser! Welcome to bashdemo!
In Bash, there's no concatenation operator like Perl or PHP's dot (.); to concatenate strings, you just put them next to each other. This can be a good idea if you have a mix of literal strings and variables in a single shell word, as it can help you avoid getting caught out by a stray dollar sign, backtick, exclamation mark, or backslash within double-quote pairs.