Previously-functional gawk script now failing to execute - PLEASE HELP!!!

Eliot Moss moss@cs.umass.edu
Wed Sep 15 21:43:54 GMT 2021


On 9/15/2021 5:11 PM, Bryan VanSchouwen via Cygwin wrote:
> Hello.
> 
> I just tried executing an old, previously-functional awk script using a
> version of gawk that I had downloaded last year, and a command of the
> following format (as recommended in a previous communication with the
> Cygwin mailing list):
> gawk -vRS="\r\n" -f data_collect_e_-_FF_4-state.awk
> but this time, the script failed to execute!!
> 
> Upon closer examination, the script appears to be failing after
> successfully reading the first line of data from the input data file, even
> though the input file has NOT been modified since it was last used.  (I
> should point out that while the files were copied over from my old
> computer, another awk script execution that I had attempted recently with
> older files worked fine!)

Ignoring the shouting :-) ...

That command line assumes that the program will see \r\n
at the end of each line of input.  That is indeed the usual
line ending on Windows.  However!  Since it is not the usual
line ending on Posix (what Cygwin aims to be like), there
are various options/flags that can affect an internal
translation that effectively changes \r\n to \n, or
something like that.

Others will be able to supply the details more readily
than I, but I would look at the environment variable and
startup options to Cygwin around this point and see where
that leads you.

Regards - Eliot Moss


More information about the Cygwin mailing list