官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 调兵山市| 新建县| 融水| 怀安县| 任丘市| 西充县| 运城市| 郑州市| 哈巴河县| 乐亭县| 三门峡市| 长子县| 霞浦县| 广元市| 得荣县| 黄冈市| 略阳县| 丹寨县| 廉江市| 永川市| 巴东县| 永定县| 金坛市| 朔州市| 洛阳市| 建德市| 赞皇县| 镇坪县| 灵山县| 衢州市| 石柱| 沙坪坝区| 阿城市| 峨眉山市| 重庆市| 凌源市| 迁西县| 枣阳市| 突泉县| 大洼县| 龙口市|