Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com> List-Archive: <http://sources.redhat.com/ml/cygwin/> List-Post: <mailto:cygwin AT cygwin DOT com> List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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 Date: Mon, 15 Apr 2002 17:33:33 +0200 (MEST) From: Markus Brandt <MaBrandt AT gmx DOT net> To: cygwin AT cygwin DOT com MIME-Version: 1.0 Subject: Re: Bug - GAWK prints wrong CR when called outside from cygwin X-Priority: 3 (Normal) X-Authenticated-Sender: #0000782713 AT gmx DOT net X-Authenticated-IP: [194.121.220.201] Message-ID: <25998.1018884813@www50.gmx.net> X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, on Fri, 12 Apr 2002 14:03:29 +0200 Corinna Vinschen wrote: > On Fri, Apr 12, 2002 at 01:53:53PM +0200, Markus Brandt wrote: >> Hello, >> >> when gawk is called outside the cygwin runtime, i.e. called from a command >> prompt under Windows, and it's input is redirected to a pipe with an output of >> a non-cygwin command, e.g. the Windows DIR, it does not recognize this. >> As a result input conversion from "\r\n" to "\n" isn't performed an >> additional "\r"s are printed. > > Beep! cmd is appending the additional line feed. Not gawk. Try > *any* command in cmd and you will see an empty line before the > prompt returns Not exactly what I mentioned. Of course any DOS command prints its output with "\r\n", whereas UNIX delims with "\n". The difference is that gawk doesn't scan its input - when it is redirected via a pipe - whether it is a DOS or UNIX textfile and doesn't do a internal conversion of the lines delimiters. Let me explain it a little bit more clearly (see my former example): C:\TEMP\foo>dir /b | gawk '{print $0 $0}' ==> prints it output with "\r"; e.g. bar_1 C:\TEMP\foo>dir /b > foo C:\TEMP\foo>gawk '{print $0 $0}' < foo ==> print it output correctly; e.g. bar_1bar_1 Markus -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/