Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyMerlin committed Jun 9, 2021
1 parent cc594c9 commit d290240
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions docs/operating-system/Shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@

简单来说“Shell编程就是对一堆Linux命令的逻辑化处理”。


W3Cschool 上的一篇文章是这样介绍 Shell的,如下图所示。
![什么是 Shell?](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/18-11-26/19456505.jpg)

Expand Down Expand Up @@ -91,7 +90,7 @@ shell中 # 符号表示注释。**shell 的第一行比较特殊,一般都会
**Shell编程中一般分为三种变量:**

1. **我们自己定义的变量(自定义变量):** 仅在当前 Shell 实例中有效,其他 Shell 启动的程序不能访问局部变量。
2. **Linux已定义的环境变量**(环境变量, 例如:$PATH, $HOME 等..., 这类变量我们可以直接使用),使用 `env` 命令可以查看所有的环境变量,而set命令既可以查看环境变量也可以查看自定义变量。
2. **Linux已定义的环境变量**(环境变量, 例如:`PATH`, ​`HOME` 等..., 这类变量我们可以直接使用),使用 `env` 命令可以查看所有的环境变量,而set命令既可以查看环境变量也可以查看自定义变量。
3. **Shell变量** :Shell变量是由 Shell 程序设置的特殊变量。Shell 变量中有一部分是环境变量,有一部分是局部变量,这些变量保证了 Shell 的正常运行

**常用的环境变量:**
Expand Down Expand Up @@ -347,7 +346,6 @@ echo $a;
简单示例:

```shell

#!/bin/bash
a="abc";
b="efg";
Expand Down Expand Up @@ -530,8 +528,6 @@ echo "输入的两个数字之和为 $?"

### 带参数的函数



```shell
#!/bin/bash
funWithParam(){
Expand All @@ -544,7 +540,6 @@ funWithParam(){
echo "作为一个字符串输出所有参数 $* !"
}
funWithParam 1 2 3 4 5 6 7 8 9 34 73

```

输出结果:
Expand All @@ -557,5 +552,4 @@ funWithParam 1 2 3 4 5 6 7 8 9 34 73
第十一个参数为 73 !
参数总数有 11 个!
作为一个字符串输出所有参数 1 2 3 4 5 6 7 8 9 34 73 !
```

0 comments on commit d290240

Please sign in to comment.