# Initialize variables
#!/usr/bin/ksh
FILENM=$1
INDEX=0
# read filename
echo "You are working with the Config file: $FILENM"
while read line
do
echo $line
data[$INDEX]=$line
((INDEX=INDEX+1))
done <"$FILENM"
# Test data array
echo "What line would you like to look at?"
read INDEX
echo "Output: $data[$INDEX]"
But when I run it, I get:
ncm@cwncm:~/work> ./ThisConf.sh ios.cfg
You are working with the Config file: ios.cfg
!
version 12.4
service timestamps debug datetime msec
.
.
.
.
end
What line would you like to look at?
5
Output: [5]