delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/02/08:16:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <200006021208.OAA31363@arnljot.lin.foa.se>
X-Mailer: exmh version 2.1.1 10/15/1999
To: cygwin AT sourceware DOT cygnus DOT com
Subject: awk problem with embedded awk scripts...
From: Christian =?iso-8859-1?Q?J=F6nsson?= FOA =?iso-8859-1?Q?Informations=F6verf=F6ring?= <chj AT lin DOT foa DOT se>
X-face: 2tQjSw>|IA680lA7r'G9Y[jfoS>tTPw4-B#mQo_C+{6>^DWZP`o.h<N!-!iBER AT 5!"`:9^t
~MyeXP43[]t)W-sTm)TibB_c4=**35T?X(,6,POUlqae[Aq$"zn4hN{{w@(=rYp\i=\wUyhL
X-URL: http://www.foa.se
Mime-Version: 1.0
Mime-Version: 1.0
Date: Fri, 02 Jun 2000 14:08:28 +0200
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id IAA24340

I have a problem with running a test suite of a network simulator 
(http://www-mash.cs.berkeley.edu/ns/ns.html) and I have been told 
before to suspect binary mount / text file problems with awk but who 
knows.

This is what I get as output:
ns: _o4 finish_flows test_flows_unforced: awk.exe: cmd. line:4:
        print "
awk.exe: cmd. line:4:                               ^ unterminated string
    while executing
"exec awk [$self $awkprocedure_] $flowfile >@ $outdesc"
    (procedure "_o4" line 26)
    (TestSuite create_flow_graph line 26)
    invoked from within
"$self create_flow_graph $testname $flowgraphfile"
    (procedure "_o4" line 6)
    (TestSuite finish_flows line 6)
    invoked from within
"_o4 finish_flows test_flows_unforced"

and the tcl file containing the supposedly malfunctioning awk (code) has 
this:

TestSuite instproc allmakeawk { } {
    set awkCode {
        BEGIN {prev=-1; tot_bytes=0; tot_packets=0; forced_total=0; unforced_total=0}
        {
            if ($5 != prev) {
                print " "; print "\"flow ",$5;
                prev = $5
            }
            tot_bytes = $19-$11;
            forced_total= $16-$14;
            tot_packets = $10;
            tot_arrivals = $9;
            unforced_total = $14;
            if (unforced_total + forced_total > 0) {
                if ($14 > 0) {
                    frac_packets = tot_packets/$14;
                }
                else { frac_packets = 0;}
                if ($17-$15 > 0) {
                    frac_bytes = tot_bytes/($17-$15);
                }
                else {frac_bytes = 0;} 
                if ($13 > 0) {
                    frac_arrivals = tot_arrivals/$13;
                }
                else {frac_arrivals = 0;}
                if (frac_packets + frac_bytes > 0) {
                    unforced_total_part = frac_packets * unforced_total / ( unforced_total + forced_total)
                    forced_total_part = frac_bytes * forced_total / ( unforced_total + forced_total)
                    print 100.0 * frac_arrivals, 100.0 * ( unforced_total_part +forced_total_part)
                }
            }
        }
    }
    return $awkCode
}

The problem is at print " "; print "\"flow ",$5; The first print 
statement when passed from tcl script code to the awk program hits 
something nasty. Now, the tcl used is a native (binary release) of 
tcl8.0.5 for win32...

Any help or hint is greatly appreciated. 

TIA,

/ChJ


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019