#!/bin/bash aaa=( )
bbb=(a b c d) set -- ${aaa[@]}
while (($#>));do
echo ${}
shift
done set -- echo "-----------------------" set -- ${bbb[@]}
while (($#>));do
echo ${}
shift
done
set -- ----------(结果)-------------- -----------------------
a
b
c
d
#!/bin/bash aaa=( )
bbb=(a b c d) set -- ${aaa[@]}
while (($#>));do
echo ${}
shift
done set -- echo "-----------------------" set -- ${bbb[@]}
while (($#>));do
echo ${}
shift
done
set -- ----------(结果)-------------- -----------------------
a
b
c
d