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 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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: > > > /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. > > > 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