Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <20010905041211.89275.qmail@web12601.mail.yahoo.com> Date: Wed, 5 Sep 2001 05:12:11 +0100 (BST) From: =?iso-8859-1?q?hrishy?= Subject: Re: awk script compile problem To: Keith Seitz , hrishy Cc: cygwin AT cygwin DOT com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello Keith I am glad that you responded.Thanks a lott buddy for the help. regards Hrishy --- Keith Seitz wrote: > On Tue, 4 Sep 2001, [iso-8859-1] hrishy wrote: > > > a few minutes ago i installed cygwin and i tried > to > > run the following program. > > I doubt very much that this worked on anything. This > awk program clearly > has an obvious syntax error. On RH7.0: > > keiths ~ >awk -f a.awk > awk: a.awk:10: if (( $2 ~ /Label/ ) && ( $3 ~ > /Not found/ )) { > awk: a.awk:10: ^ parse error > awk: a.awk:13: if (( $2 ~ /Form/ ) && ( $3 ~ > /Not found/ )) { > awk: a.awk:13: ^ parse error > awk: a.awk:16: if (( $2 ~ /Report/ ) && ( $3 ~ > /Not found/ )){ > awk: a.awk:16: ^ parse error > > I also get similar errors on Solaris using its > standard awk: > > keiths ~ >/usr/bin/awk -f a.awk > awk: syntax error near line 10 > awk: bailing out near line 10 > > The structure of an awk program looks like ("..." = > statements): > > [BEGIN] { ... } > { ... } > [END] { ... } > > Not like what you have: > > { ... } > ... > END { ... } > > Add braces ("{","}") at the appropriate places and > it will work just fine. > > > #BEGIN > > { > > FS="|" > > } > Add "{" here. > > > if (( $2 ~ /Label/ ) && ( $3 ~ /Not found/ > )) { > > label=label+1 > > } > > if (( $2 ~ /Form/ ) && ( $3 ~ /Not found/ )) > { > > form=form+1 > > } > > if (( $2 ~ /Report/ ) && ( $3 ~ /Not found/ > )){ > > report=report+1 > > } > Add "}" here. > > > END { print FILENAME, "\t" label "\t"form "\t" > report > > >>"result.log"} > > > > this program runs correctly under mkstoolkit and > on my > > linux box.but fails to under cygwin. > > > > with a parse error ^ if (( $2 ~ /Report/ ) && > ( $3 > > ~ /Not found/ )){ > > Keith > > ____________________________________________________________ Do You Yahoo!? Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk or your free @yahoo.ie address at http://mail.yahoo.ie -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/