delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/11/24/04:18:07

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 24 Nov 2011 10:17:11 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: An AWK-ward problem...
Message-ID: <20111124091711.GJ21190@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <0124A9436EBA7D4D84E25C4CCB0F9AAF01AA593FEE71 AT ENT-MAILBOX02 DOT vsms DOT state DOT vt DOT us>
MIME-Version: 1.0
In-Reply-To: <0124A9436EBA7D4D84E25C4CCB0F9AAF01AA593FEE71@ENT-MAILBOX02.vsms.state.vt.us>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


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