Array in Bash
变量
$VAR
或者
${VAR}
数组
${VAR[$i]}
打印整个数组
echo ${VAR[@]}
统计数组元素个数
echo ${#VAR[@]}
从文件读入数组
(按行读入)
VAR=(`cat 'eg.txt'`)
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here