#!/bin/bash arr=("0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "e" "e" "f") for value in ${arr[@]} do echo $value done # 或者采取如下方式 echo "----------------------another way----------------------" for (( i = 0 ; i < ${#arr[@]} ; i++ )) do echo ${arr[$i]} done