- Bash Quick Start Guide
- Tom Ryder
- 115字
- 2021-07-23 16:58:57
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.
推薦閱讀
- 基于C語言的程序設計
- 大數據技術基礎
- Spark編程基礎(Scala版)
- Excel 2007函數與公式自學寶典
- 西門子S7-200 SMART PLC從入門到精通
- Security Automation with Ansible 2
- PostgreSQL Administration Essentials
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 貫通Java Web開發三劍客
- Visual FoxPro程序設計
- 嵌入式GUI開發設計
- MATLAB-Simulink系統仿真超級學習手冊
- 機器人制作入門(第4版)
- Learn Microsoft Azure
- Generative Adversarial Networks Projects