File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
docs/cs-basics/operating-system Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -110,29 +110,29 @@ echo "helloworld!"
110110
111111字符串是 shell 编程中最常用最有用的数据类型(除了数字和字符串,也没啥其它类型好用了),字符串可以用单引号,也可以用双引号。这点和 Java 中有所不同。
112112
113- 在单引号中所有的特殊符号,如$和反引号都没有特殊含义。在双引号中,除了"$"," \" 和反引号 ,其他的字符没有特殊含义。
113+ 在单引号中所有的特殊符号,如$和反引号都没有特殊含义。在双引号中,除了"$"、" \\ "、反引号和感叹号(需开启 ` history expansion ` ) ,其他的字符没有特殊含义。
114114
115115** 单引号字符串:**
116116
117117``` shell
118118#! /bin/bash
119119name=' SnailClimb'
120- hello=' Hello, I am ' $name ' !'
120+ hello=' Hello, I am $name!'
121121echo $hello
122122```
123123
124124输出内容:
125125
126126```
127- Hello, I am ' $name' !
127+ Hello, I am $name!
128128```
129129
130130** 双引号字符串:**
131131
132132``` shell
133133#! /bin/bash
134134name=' SnailClimb'
135- hello=" Hello, I am " $name " !"
135+ hello=" Hello, I am $name !"
136136echo $hello
137137```
138138
You can’t perform that action at this time.
0 commit comments