- echo用于显示变量:
name=fz
echo $name
///
name="fz's name"
name=fz\'s\ name
- 变量键盘read
read [-pt] variable
example:read -p "please input your name/: " -t 30 name (将输入的值存入name中)
- array变量//和javascript设置变量的方法一样
var[1]="asd"
var[2]="123"
var[3]="345"
echo ${var[1]}, ${var[2]}, ${var[3]}