Thursday, March 4, 2010

Read file writting strings into array

declare -a ARRAY
count=0

while read line; do
echo $line
ARRAY[$count]=$line
let count=count+1
echo $count
done < ips.tmp

echo ${ARRAY[1]}
echo ${#ARRAY[@]}

No comments: