[gentoo-user] Help with bash/awk script

2006-08-23 Thread Ow Mun Heng
I'm trying to figure out how to do this sequence in this bash script. The problem I'm having is how to make $i to change according to the changes in $x My current solution is a bit of a hack and stupid. One more thing, my current solution will parse the file _each_ time for _each_value/head

Re: [gentoo-user] Help with bash/awk script

2006-08-23 Thread Etaoin Shrdlu
On Wednesday 23 August 2006 16:30, Ow Mun Heng wrote: if [ $x -eq 0 ]             then   for i in `seq 1 7` -                     do                      tpiert=`egrep -i (average) $1 | awk -v pat=$i '{ if(NR==pat) print $5,$10}'`                          echo

Re: [gentoo-user] Help with bash/awk script

2006-08-23 Thread Bo Ørsted Andresen
On Wednesday 23 August 2006 16:30, Ow Mun Heng wrote: (Does awk parse the file once or multiple times, that is if I were to rewrite the below entirely in awk language) awk parses the file only once. One line at a time. Of course that goes for every invocation of awk... ;) finaltpi=`cat $1

Re: [gentoo-user] Help with bash/awk script

2006-08-23 Thread Ow Mun Heng
On Wed, 2006-08-23 at 17:17 +0200, Etaoin Shrdlu wrote: On Wednesday 23 August 2006 16:30, Ow Mun Heng wrote: if [ $x -eq 0 ] then for i in `seq 1 7` - do tpiert=`egrep -i (average) $1 | awk -v pat=$i '{ if(NR==pat) print

Re: [gentoo-user] Help with bash/awk script

2006-08-23 Thread Ow Mun Heng
On Wed, 2006-08-23 at 17:20 +0200, Bo Ørsted Andresen wrote: On Wednesday 23 August 2006 16:30, Ow Mun Heng wrote: (Does awk parse the file once or multiple times, that is if I were to rewrite the below entirely in awk language) awk parses the file only once. One line at a time. Of course