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