|
发表于 2006-8-19 00:51:40
|
显示全部楼层
Post by Iambitious
or maybe this code can work well- count=0
- for item in $a;
- do
- let 'count=count+1'
- if [ $count -eq 1 ];then
- x=$item
- count=0
- echo $x
- else
- y=$item
- echo $y
- fi
- done
复制代码 I doubt. First of all, loop still bases on step 1. you are not reading 2 at a time. Second, I do not think you can have y assigned even though you set count to 0 but that if test has been done. |
|