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

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.

主站蜘蛛池模板: 郧西县| 乌鲁木齐县| 新密市| 南宫市| 桐梓县| 老河口市| 屏南县| 新河县| 郁南县| 扬中市| 盘山县| 岚皋县| 宁城县| 莱西市| 遂昌县| 昌宁县| 靖州| 东至县| 密山市| 连云港市| 新蔡县| 枣庄市| 晋中市| 灵石县| 神木县| 香港 | 江西省| 贺兰县| 临潭县| 收藏| 陕西省| 临桂县| 上犹县| 乌拉特后旗| 宕昌县| 中方县| 故城县| 冷水江市| 延津县| 峨边| 莆田市|