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
时间: 2024-10-24 04:09:52
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