Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
YiRanCN committed Mar 26, 2024
1 parent 3a0cff1 commit 60c1ea5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/study/devops/SHELL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### SHELL脚本参数

#### 位置参数

脚本通过位置参数来获取命令行中的参数。位置参数通过标准数字表示,例如`$0`代表脚本名称,`$1`代表第一个参数,`$2`代表第二个参数,依此类推。

#### 参数计数

使用`$#`可以测试执行脚本时包含的命令行参数个数。如果无参数,`$#`为0。

#### 获取所有数据:

使用`$*`可以将命令行中提供的所有参数作为一个单词处理,它将多个参数看成一个参数。使用`$@`则将命令行中提供的所有参数作为同一个字符串中的多个单词处理。

#### 移位:

使用`shift`命令可以改变命令行参数的相对位置。默认为每个参数变量左移一个位置,`$0`不变。

#### 处理选项:

选项是由破折号引导的单个字母,用于更改命令的行为。例如,`-n`参数可以用来检查参数是否存在。
5 changes: 5 additions & 0 deletions docs/study/docker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ sidebar_position: 1
### docker 官方镜像库 docker hub

- [docker hub](https://hub.docker.com/)
- [docker hub-stage](https://hub-stage.docker.com/)
### docker 私有镜像仓库软件

- [harbor](https://github.com/goharbor/harbor)
- [docker官方私有registry](https://hub.docker.com/_/registry)

0 comments on commit 60c1ea5

Please sign in to comment.