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

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.

主站蜘蛛池模板: 策勒县| 曲麻莱县| 搜索| 土默特右旗| 林甸县| 农安县| 米易县| 怀仁县| 田林县| 澄迈县| 郸城县| 凭祥市| 易门县| 十堰市| 阜阳市| 成都市| 河南省| 繁峙县| 彩票| 隆化县| 民和| 肥西县| 乌拉特中旗| 苏尼特左旗| 鄂温| 中方县| 临澧县| 抚顺县| 永福县| 太和县| 焉耆| 克东县| 绍兴县| 阳泉市| 安顺市| 全南县| 霍山县| 仁寿县| 赤壁市| 天峻县| 莎车县|