数组

image.png
https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays

特殊变量

Variables Description
$0 The filename of the current script.
$1-$9 Stores the names of the first 9 arguments or can be used as the arguments’ positions.
$$ The process id of the current shell.
$# The number of arguments supplied to a script.
$* Stores all the command line arguments by joining them together.
$@ Stores the list of arguments as an array.
$? Specifies the exit status of the last command or the most recent execution process.
$! Shows the id of the last background command.
$- Shows the options set used in the current bash shell.

https://blog.knoldus.com/special-variables-in-bash-scripting/#section_2 上一条指令的信息image.png

循环

image.png
https://www.cyberciti.biz/faq/bash-for-loop/