变量
shell 变量
命名规则
for file in `ls /etc`
# 或
for file in $(ls /etc)使用变量 ${var}
${var}只读变量 readonly
readonly删除变量 unset
unset函数作用域内的变量 local
local变量类型
局部变量
环境变量
shell变量
数据类型
shell 字符串
单引号
双引号
拼接字符串
获取字符串长度 (#)
#)字符串截取
字符串查找
shell 数组
数组定义
读取数组 ${arr[index]}
${arr[index]}获取数组长度
注释
Last updated