#!/bin/bash
file=ip.txt
i=0
for line in `cat ip.txt`
do
array[$i]=$line
let i+=1
done
for (( i=0;i<${#array[@]};i++))#数组长度
do
echo ${array[i]}
done
#!/bin/bash
file=ip.txt
i=0
for line in `cat ip.txt`
do
array[$i]=$line
let i+=1
done
for (( i=0;i<${#array[@]};i++))#数组长度
do
echo ${array[i]}
done