Skip to content

Commit 5701da6

Browse files
authored
chore: format markdown code. (jaywcjlove#42)
* format: fix markdown * update: fix markdown * update: fix cron problems * update: delete .markdownlintignore * update * chore: add tab -> 4 space * chore: fix tab -> 2 in the .editorconfig
1 parent ea80136 commit 5701da6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1075
-1126
lines changed

.editorconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[./docs/*.md]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
insert_final_newline = true

.lintstagedrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"**/*.{mjs,css,json,prettierrc,lintstagedrc}": ["prettier --write"],
3-
"./docs/*.md": ["markdownlint --fix ./docs"]
3+
"./docs/*.md": ["npx markdownlint-cli --fix ./docs"]
44
}

.markdownlint.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
"MD014": false,
55
"MD024": false,
66
"MD033": false,
7-
"MD040": false
7+
"MD040": false,
8+
"MD010": {
9+
"code_blocks": true,
10+
"spaces_per_tab": 4
11+
}
812
}

docs/ansible.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Ansible 备忘清单
1818

1919
- [Ansible 官方文档](https://docs.ansible.com)
2020

21-
2221
### 配置位置
2322

2423
文件路径 | 说明
@@ -27,7 +26,6 @@ Ansible 备忘清单
2726
`~/ansible.cfg` | 用户特定的配置
2827
`$pwd/ansible.cfg` | 当前目录下的配置
2928

30-
3129
### Inventory文件(hosts列表)
3230

3331
#### 静态Inventory
@@ -86,6 +84,7 @@ proxy=proxy.atlanta.example.com
8684
```shell
8785
$ ansible all --list-hosts
8886
```
87+
8988
ping所有目标
9089

9190
```shell
@@ -108,19 +107,19 @@ $ ansible all -i localhost, -e '{"ansible_connection": "local"}' -a 'hostname'
108107

109108
```shell
110109
$ ansible all -i localhost, -e '{"ansible_connection": "local"}' -m setup
111-
```
110+
```
112111
<!--rehype:className=wrap-text -->
113112
获取远程到本地
114113

115114
```shell
116115
$ ansible target -m fetch -a "src=/tmp/seq dest=/tmp/seq"
117-
```
116+
```
118117
<!--rehype:className=wrap-text -->
119118
拷贝本地到远程
120119

121120
```shell
122121
$ ansible target -m copy -a "src=/tmp/seq dest=/tmp/seq"
123-
```
122+
```
124123
<!--rehype:className=wrap-text -->
125124

126125
### Ansible 命令帮助
@@ -131,7 +130,7 @@ $ ansible
131130
$ ansible <host-pattern> [options]
132131
```
133132

134-
----
133+
---
135134

136135
:- | -
137136
:- | -
@@ -219,7 +218,6 @@ $ ansible-galaxy init --offline <ROLE>
219218
```
220219
<!--rehype:className=wrap-text-->
221220

222-
223221
### ansible-doc
224222

225223
在本地访问文档
@@ -241,13 +239,13 @@ $ ansible-doc [options] [module...]
241239
`--version` | 显示程序的版本号并退出
242240
<!--rehype:className=style-list-->
243241

244-
245242
### ansible-vault
246243

247244
```bash
248245
$ ansible-vault
249246
$ ansible-vault [create|decrypt|edit|encrypt|rekey|view] [--help] [options] vaultfile.yml
250247
```
248+
251249
---
252250

253251
:- | -
@@ -268,6 +266,7 @@ $ ansible-vault [create|decrypt|edit|encrypt|rekey|view] [--help] [options] vaul
268266
$ ansible-playbook
269267
$ ansible-playbook playbook.yml
270268
```
269+
271270
---
272271

273272
:- | -
@@ -329,13 +328,14 @@ $ ansible-playbook playbook.yml
329328
`-K`, `--ask-become-pass` | 要求提权密码
330329
<!--rehype:className=style-list-->
331330

332-
### ansible-pull
331+
### ansible-pull
333332
<!--rehype:wrap-class=row-span-2-->
334333

335334
```bash
336335
$ ansible-pull
337336
$ ansible-pull -U <repository> [options]
338337
```
338+
339339
---
340340

341341
:- | -
@@ -394,10 +394,9 @@ $ ansible-pull -U <repository> [options]
394394
<!-- ### ansible-playbook -->
395395
<!-- todo -->
396396

397-
398-
399397
另见
400398
---
399+
401400
[Getting started with Ansible](https://docs.ansible.com/ansible/latest/getting_started/index.html)
402401
[Introduction to ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html)
403402
[Ansible cheatsheet](https://github.com/luckylittle/ansible-cheatsheet/blob/master/ansible-cheatsheet.txt)

docs/awk.md

+12-14
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $ awk -F: '{print $1, $NF}' /etc/passwd
2525
| | `$NF` | 最后一个字段 |
2626
| | `/etc/passwd` | 输入数据文件 |
2727

28-
### Awk 程序
28+
### Awk 程序
2929

3030
```bash
3131
BEGIN {<初始化>}
@@ -59,7 +59,8 @@ $0/NR ▶ │ 1 │ baidu.com │ awk │
5959
$0/NR ▶ │ 2 │ google.com │ 25 │
6060
└──────┴──────────────┴───────┘
6161
```
62-
---
62+
63+
----
6364

6465
```shell
6566
# 第一个和最后一个字段
@@ -253,7 +254,6 @@ awk -v varName="$PWD" '
253254
END {print varName}' </dev/null
254255
```
255256

256-
257257
Awk 运算符
258258
---------
259259

@@ -291,17 +291,17 @@ Awk 运算符
291291
- `*`
292292
- `/`
293293
- `%`
294-
- `++`
295-
- `--`
294+
- `++`
295+
- `--`
296296
<!--rehype:className=cols-3 style-none-->
297297

298298
#### 速记作业
299299

300-
- `+=`
301-
- `-=`
302-
- `*=`
303-
- `/=`
304-
- `%=`
300+
- `+=`
301+
- `-=`
302+
- `*=`
303+
- `/=`
304+
- `%=`
305305
<!--rehype:className=cols-3 style-none-->
306306

307307
#### 比较运算符
@@ -366,7 +366,6 @@ Awk 函数
366366
`toupper(s)` | 字符串 `s` 转大写
367367
`getline` | 将 `$0` 设置为当前输入文件中的下一个输入记录
368368

369-
370369
### 用户定义函数
371370

372371
```shell
@@ -424,7 +423,6 @@ awk 'BEGIN {
424423
}'
425424
```
426425

427-
428426
### 带拆分的数组
429427

430428
```shell
@@ -536,7 +534,6 @@ awk -F: '{
536534
}' /etc/passwd
537535
```
538536

539-
540537
Awk 循环
541538
----------
542539

@@ -744,6 +741,7 @@ daemon /sbin
744741
-------------
745742

746743
### 正则表达式元字符
744+
747745
- `\`
748746
- `^`
749747
- `$`
@@ -785,4 +783,4 @@ $ awk -f demo.awk /etc/passwd
785783
--------
786784
787785
- [GNU awk 用户指南](https://www-zeuthen.desy.de/dv/documentation/unixguide/infohtml/gawk/gawk.html) _(www-zeuthen.desy.de)_
788-
- [AWK cheatsheet](https://gist.github.com/Rafe/3102414) _(gist.github.com)_
786+
- [AWK cheatsheet](https://gist.github.com/Rafe/3102414) _(gist.github.com)_

docs/bash.md

+24-31
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ NAME = "John" # => Error (关于空间)
6464

6565
见:[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
6666

67-
6867
### 函数
6968

7069
```bash
@@ -204,7 +203,7 @@ DIRPATH=${SRC%$BASEPATH}
204203
echo $DIRPATH # => "/path/to/"
205204
```
206205

207-
### Transform
206+
### Transform
208207

209208
```bash
210209
STR="HELLO WORLD!"
@@ -220,7 +219,7 @@ echo "${ARR[@],}" # => hello world
220219
echo "${ARR[@]^}" # => Hello World
221220
```
222221

223-
Bash 数组
222+
Bash 数组
224223
------
225224

226225
### 定义数组
@@ -247,14 +246,14 @@ Numbers+=(4 5) # 附加 => 1 2 3 4 5
247246

248247
:- | -
249248
:- | -
250-
`${Fruits[0]}` | 第一个元素
251-
`${Fruits[-1]}` | 最后一个元素
252-
`${Fruits[*]}` | 所有元素
253-
`${Fruits[@]}` | 所有元素
254-
`${#Fruits[@]}` | 总数
255-
`${#Fruits}` | 第一节长度
256-
`${#Fruits[3]}` | 第n个长度
257-
`${Fruits[@]:3:2}` | 范围
249+
`${Fruits[0]}` | 第一个元素
250+
`${Fruits[-1]}` | 最后一个元素
251+
`${Fruits[*]}` | 所有元素
252+
`${Fruits[@]}` | 所有元素
253+
`${#Fruits[@]}` | 总数
254+
`${#Fruits}` | 第一节长度
255+
`${#Fruits[3]}` | 第n个长度
256+
`${Fruits[@]:3:2}` | 范围
258257
`${!Fruits[@]}` | 所有 Key
259258

260259
### 迭代 Iteration
@@ -265,7 +264,9 @@ for e in "${Fruits[@]}"; do
265264
echo $e
266265
done
267266
```
267+
268268
#### With index
269+
269270
```bash
270271
for i in "${!Fruits[@]}"; do
271272
printf "%s\t%s\n" "$i" "${Fruits[$i]}"
@@ -443,15 +444,14 @@ fi
443444
`[[ f1 -ot f2 ]]` | f2 早于 f1
444445
`[[ f1 -ef f2 ]]` | 相同的文件
445446

446-
447447
### 更多条件
448448

449449
条件 | 描述
450450
:- | -
451451
`[[ -o noclobber ]]` | 如果启用 OPTION
452452
`[[ ! EXPR ]]` | 不是 Not
453453
`[[ X && Y ]]` | 和 And
454-
`[[ X \|\| Y ]]` | 或者 Or
454+
`[[ X \|\| Y ]]` | 或者 Or
455455

456456
### 逻辑和,或
457457

@@ -554,7 +554,7 @@ until [ $count -gt 10 ]; do
554554
done
555555
```
556556

557-
### 永远
557+
### 永远
558558

559559
```bash
560560
while true; do
@@ -570,7 +570,6 @@ while :; do
570570
done
571571
```
572572

573-
574573
### 正在读取行
575574

576575
```bash
@@ -720,8 +719,7 @@ Bash 历史
720719

721720
`!!` 可以替换为任何有效的扩展,即 `!cat``!-2``!42` 等。
722721

723-
724-
各种各样的
722+
各种各样的
725723
-------------
726724

727725
### 数值计算
@@ -741,7 +739,6 @@ $(($RANDOM%200)) # Random number 0..199
741739
pwd # still in first directory
742740
```
743741

744-
745742
### 检查命令
746743

747744
```bash
@@ -765,7 +762,6 @@ python hello.py &>/dev/null # 标准输出和标准错误到(空null)
765762
python hello.py < foo.txt # 将 foo.txt 提供给 python 的标准输入
766763
```
767764

768-
769765
### 来源相对
770766

771767
```bash
@@ -791,7 +787,6 @@ case "$1" in
791787
esac
792788
```
793789

794-
795790
### 陷阱错误
796791
<!--rehype:wrap-class=col-span-2-->
797792

@@ -862,7 +857,6 @@ fi
862857

863858
[特殊参数](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables)
864859

865-
866860
### grep 检查
867861
<!--rehype:wrap-class=col-span-2-->
868862

@@ -872,11 +866,10 @@ if grep -q 'foo' ~/.bash_history; then
872866
fi
873867
```
874868

875-
876869
### 反斜杠转义
877870
<!--rehype:wrap-class=row-span-2-->
878871

879-
- &nbsp;
872+
- &nbsp;
880873
- \!
881874
- \"
882875
- \#
@@ -963,11 +956,11 @@ echo "${args[@]}"
963956
另见
964957
----
965958

966-
* [Shell 教程](https://jaywcjlove.github.io/shell-tutorial) _(jaywcjlove.github.io)_
967-
* [Devhints](https://devhints.io/bash) _(devhints.io)_
968-
* [Bash-hackers wiki](http://wiki.bash-hackers.org/) _(bash-hackers.org)_
969-
* [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_
970-
* [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
971-
* [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
972-
* [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_
973-
* [shell - Standard Shell](https://devmanual.gentoo.org/tools-reference/bash/index.html) _(devmanual.gentoo.org)_
959+
- [Shell 教程](https://jaywcjlove.github.io/shell-tutorial) _(jaywcjlove.github.io)_
960+
- [Devhints](https://devhints.io/bash) _(devhints.io)_
961+
- [Bash-hackers wiki](http://wiki.bash-hackers.org/) _(bash-hackers.org)_
962+
- [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_
963+
- [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
964+
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
965+
- [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_
966+
- [shell - Standard Shell](https://devmanual.gentoo.org/tools-reference/bash/index.html) _(devmanual.gentoo.org)_

0 commit comments

Comments
 (0)