The following example demonstrates how to load a text file into array in a Bash Shell.
#!/bin/sh
count=0
while read line
do
ARR[$count]=$line
((count++))
done < /tmp/infile
for LINE in ${ARR[*]}
do
echo $LINE
done
The following example demonstrates how to load a text file into array in a Bash Shell.
#!/bin/sh
count=0
while read line
do
ARR[$count]=$line
((count++))
done < /tmp/infile
for LINE in ${ARR[*]}
do
echo $LINE
done