|
发表于 2006-7-31 20:15:55
|
显示全部楼层
- [0 No.2014 huan@deb /tmp/work]$ cat txt
- aa
- bb
- cc
-
- [0 No.2015 huan@deb /tmp/work]$ ./arr.sh txt
- aa
- bb
- cc
- [0 No.2016 huan@deb /tmp/work]$ cat arr.sh
- #! /bin/bash
- file=$1
- i=0
- while read line;do
- a[$i]="$line"
- ((i++))
- done < $file
- for val in ${a[*]};do
- echo $val
- done
- [0 No.2017 huan@deb /tmp/work]$
复制代码 |
|