Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/shellAdvanced/regular_expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ $
```bash
$ sed -n '/[ch]at/p' data6
The cat is sleeping.
这里用到的数据文件和点号特殊字符例子中的一样,但得到的结果却不一样。这次我们成功滤掉了只包含单词at的行。匹配这个模式的单词只有cat和hat。还要注意以at开头的行也没有匹配。字符组中必须有个字符来匹配相应的位置。
That is a very nice hat.
$
```
Expand Down Expand Up @@ -733,7 +732,7 @@ $

这个例子会匹配数据流文本中的 cat、hat 或 dog。

### 管道符号
### 圆括号

正则表达式模式也可以用圆括号进行分组。当你将正则表达式模式分组时,该组会被视为一个标准字符。可以像对普通字符一样给该组使用特殊字符。举个例子:

Expand Down
3 changes: 2 additions & 1 deletion docs/shellAdvanced/sed_gawk_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ $
```bash
$ sed '3,${
> s/brown/green/
> s/lazy/active/ > }' data1.txt
> s/lazy/active/
> }' data1.txt
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick green fox jumps over the active dog.
Expand Down
2 changes: 1 addition & 1 deletion docs/shellAdvanced/shell_function.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Finally, try adding three numbers: -1
$
```

text6 脚本中的 addem 函数首先会检查脚本传给它的参数数目。如果没有任何参数,或者参数多于两个,addem 会返回值-1。如果只有一个参数,addem 会将参数与自身相加。如果有两个参数,addem 会将它们进行相加。
test6 脚本中的 addem 函数首先会检查脚本传给它的参数数目。如果没有任何参数,或者参数多于两个,addem 会返回值-1。如果只有一个参数,addem 会将参数与自身相加。如果有两个参数,addem 会将它们进行相加。

由于函数使用特殊参数环境变量作为自己的参数值,因此它无法直接获取脚本在命令行中的参数值。下面的例子将会运行失败。

Expand Down