problem with awk 2



hi.. all

i want to increase the number variable (m,n) at the following script in
such an order (1,1) (1,2)...(1,500)
(2,1)(2,2)...(2,500)...(500,1)(500,2)...(500,500).
problem is this ex.sh will be repeated along with (m,n), in other
words, ex.sh execute once and (m,n)=(1,1) and ex.sh execute 500'th then
that will be (500,1).
if you make the loop such as for statement outside awk statement(using
another script file), that do not affect (m,n) variable inside awk
statement.
if you make the loop statement inside awk statement, that will not
allow to repeat the script ex.sh.

so the result looks like...
1 1 i1
1 2 i2
..
..
500 500 i500

#ex.sh
awk '{i+=($1*0.00178)}; END {printf ("%i %i %1.6e\n" ,m,n,i)}' result >
output

thanks for ur help!

.



Relevant Pages

  • Re: problem with awk 2
    ... if you make the loop such as for statement outside awk statement(using ... another script file), that do not affect variable inside awk ... if you make the loop statement inside awk statement, ... allow to repeat the script ex.sh. ...
    (comp.unix.shell)
  • Re: How to rewrite with awk?
    ... > I'm unfamiliar with tools such as sed & awk. ... Extract the string that matches a RE. ... This script will not only expand all the lines that say "include ... file) and not resetting ARGV(the tmp file), it then lets awk do any ...
    (comp.unix.shell)
  • Re: Cant put tasks into the calender
    ... you can choose to display the Tasks Pane in the Calendar view ... You can use this script by Paul Berkowitz to do that. ... repeat with theTask in my theTasks ...
    (microsoft.public.mac.office.entourage)
  • parsing multi-line print blocks
    ... The script below will parse an awk script and turn statements like this: ... It's part of a shell script designed to pre-process awk scripts so you can specify pre-formatted multi-line print statements in your awk scripts for generating code from templates. ... the tool attempts to detect and remove all common leading tabs so you can write your pre-formatted block indented with tabs so it looks good in your script without those tabs appearing in the output. ... # required because command-line awk scripts cannot contain single quote ...
    (comp.lang.awk)
  • Re: awk here documents
    ... script called from shell to produce some pre-formatted blocks of code ... awk variable: ... or awk quotes with shell quotes ...
    (comp.unix.shell)