I'm trying to write a script that reads down a listcontaining various columns, if line1 column 1 != 0 then copy various field to variable field1, then check line1 column2 if > 0 this time copy to variable field2 ...
Once all columns checked I want to print the value of each variable if it exists by using a count such as
while [ mycount -lt 9 ]
do
echo $field$mycount
mycount = $((mycount))
done
all I get is field1, field2 ... and not the contents of the variable
Any ideas would be appreciated.