Gentoo Archives: gentoo-user

From: Richard Marza <richardmarzan@×××××××××.net>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Bash script inquiry
Date: Tue, 11 Aug 2009 08:07:35
Message-Id: 467A7B499C3F444FA7BA42CB5C5260BA@RichardPC
In Reply to: Re: [gentoo-user] Cloning movie DVDs with dd - only works after accessing disk with another command? by Neil Bothwick
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

Replies

Subject Author
Re: [gentoo-user] Bash script inquiry Etaoin Shrdlu <shrdlu@×××××××××××××.org>
Re: [gentoo-user] Bash script inquiry Alex Schuster <wonko@×××××××××.org>
Re: [gentoo-user] Bash script inquiry Peter Humphrey <peter@××××××××××××××.org>