Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <8C6D4989662C304087C58904BAB721A54B737C@Hermes.astrum.de>
From: Harald Kierer <Harald.Kierer@astrum.de>
To: "'Chiranth'" <chiranth.m@net-kraft.com>
Cc: cygwin@cygwin.com
Subject: RE: awk strangely outputs to file
Date: 	Fri, 7 Feb 2003 11:09:52 +0100 
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"

> From: Chiranth [mailto:chiranth.m@net-kraft.com]
> On Feb 3, Harald Kierer wrote....
> >How can awk write Windows-like text files from within the script?
> >The only way right now is to redirect the whole output like above.
> 
> perhaps you would like to keep awk working the way it is currently and
> call use the program unix2dos to convert the output file to 
> DOS format.
> 
> You can write it in a single shell script somewhat like this...
> 
> #!/bin/bash
> 
> awk -v v_OutFile="c:/x" -f example.awk /etc/passwd
> 
> dos2unix "c:/x"

Thank you for the suggestion. This is how we are dealing with the
problem right now.

> IMO it would be a pain if awk were to output data with Windows style
> line terminators.  It would affect other programs to which 
> data is piped
> from awk.

gawk did output Windows style files in our last used cygwin version
(which was quite old, but anyway). So this behaviour apparently
changed at some point and we end up changing our scripts.

bye,
 Harry

--
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/

