实例array.sh#!/bin/shi=1for file in `ls /opt`;doA[$i]=$file((i++))donefor value in ${A[*]}doecho $valuedone