Hey The array is not set the the value i want:
the below is the code:
#!/bin/bash
i=1
tnum=1
while read line
do
t=$(echo "$line" | awk '{print $3}')
if [ $i -ne $tnum ]
then
if [ $t -ne 0 ]
then
{array[$tnum]}=$t
echo ${array[$tnum]} #not showing the value
tnum=$((tnum+1))
fi
else
{array[$tnum]}=$t
echo ${array[$tnum]} #not showing the value
tnum=$((tnum+1))
fi
echo ${array1[$tnum]} #not showing the v
done < <(grep '^ID' /home/admin/cdat.txt)
please let me know why the array is not echoed when i run the program.. it is not taking at all...
|