[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Possible bug in gawk 4.1.3 running in cygwin OS Windows 7
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] Possible bug in gawk 4.1.3 running in cygwin OS Windows 7 Ultimate SP 1 |
Date: |
Wed, 8 Feb 2017 10:10:16 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi,
On Wed, Feb 08, 2017 at 01:38:41PM +0000, Christopher Durant wrote:
> This function causes the interpreter to go into what I can only describe as
> a spasm.
>
> function datetime()
> {tag = (strftime ("%Y-%m-%d") " " (strftime("%r"));
> return tag;
> }
>
>
> It fails to pass Go reporting:
>
> gawk: test2ver5.awk:36: {tag = (strftime ("%Y-%m-%d") " "
> (strftime("%r"))
> gawk: test2ver5.awk:36:
> ^ unexpected newline or end of string
>
> It then snags every subsequent line in the program with "unexpected
> newline" and "syntax error".
I'm afraid you have an extra parenthese before the 2nd strftime. Please
try this instead:
function datetime()
{tag = (strftime ("%Y-%m-%d") " " strftime("%r"));
return tag;
}
In general, if the number of opening parentheses does not match the
number of closing parentheses, you will get a syntax error. Many editors
are able to check this for you.
Regards,
Andy