while :;
read -p "pleas a number" n
do
c[$b]=$n;((b++))
echo ${c[@]}
echo ${#c[@]}
if [ ${#c[@]} -gt 2 ]
then
d=0
unset c[$d]
m=`echo ${c[@]}`
c=($m)
echo ${c[@]}
fi
done
本文出自 “学习linux” 博客,请务必保留此出处http://10265013.blog.51cto.com/10255013/1758414
原文:http://10265013.blog.51cto.com/10255013/1758414