I'm trying to run a command in a loop. I have a counter device set...the
number that the counter generates is supposed to go inside the command in
the loop after every successive iteration of the loop. This is all really to
get a general idea I've attached a snippet below.
FILE=`cat filename.txt`
TICK=`cat filename.txt | wc -l'
TOCK="0"
while [ $TICK != $TOCK ] ; do
let $TOCK=$TOCK+1
Var1= `cat FirstWordOfFirstColumnOfFirstLine` (This I actually
achieved with sed and awk)
Var2=`cat FirstFloatOfFirstLine` (The problem lies here; it's
my inability to come up with a way of implementing a variable that changes
along with the counter. so that the second time this is run it doesn't do
the first line but moved to the second line and the third line and so on...)
done
exit 0
My file is like so:
Variable Sys1 Sys2 Sys3 Sys4 Sys5
Dbase1 5.0 4.6 5.6 6. 6 .004