This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: An AWK-ward problem...
On Nov 23 15:21, Flint, Paul wrote:
> Greetings List lurkers,
>
> I have been troubleshooting some new bash script that I wrote and wanted (for some reason :^) to run on an NT box.
>
> So the struggle began...
>
> Anyway I get the oddest error:
>
> <snip>
> /cygdrive/c/Program Files/Git/bin/awk: line 7: $'\r': command not found
> /cygdrive/c/Program Files/Git/bin/awk: line 7: $'\r': command not found
> warning: LF will be replaced by CRLF in sendjcl.log.
> <snap>
>
> So... I check my code and check my code... soon the problem begins to drive me mad...
>
> Then!
>
> I do this from a cygwin ver 2.761 terminal...
>
> $cd /c/cygwin/bin
> $dos2unix awk
>
> Now awk works!
I don't believe in this solution:
- The above error messages are not Cygwin gawk error messages. They
look like bash error messages. Bash doesn't understand CRLF line
endings in scripts unless you explicitly allow that.
- /cygdrive/c/Program Files/Git/bin/awk is apparently the name of a
shell script. /cygdrive/c/Program Files/Git/bin/awk is certainly
not /bin/awk.
- /bin/awk is a symlink to /bin/gawk.exe, an executable. If you call
dos2unix on an executable, the executable will be either unchanged,
or broken with a high probability.
- Even if it doesn't matter in this scenario, Cygwin's gawk understands
CRLF line endings in awk scripts.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple