delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/07/11:31:15

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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Fri, 7 Feb 2003 11:30:54 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Harald Kierer <Harald DOT Kierer AT astrum DOT de>
cc: "'Chiranth'" <chiranth DOT m AT net-kraft DOT com>, <cygwin AT cygwin DOT com>
Subject: RE: awk strangely outputs to file
In-Reply-To: <8C6D4989662C304087C58904BAB721A54B737C@Hermes.astrum.de>
Message-ID: <Pine.GSO.4.44.0302071128180.12312-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Fri, 7 Feb 2003, Harald Kierer wrote:

> > From: Chiranth [mailto:chiranth DOT m AT net-kraft DOT 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

<http://cygwin.com/cygwin-ug-net/using-utils.html#MOUNT>
<http://cygwin.com/cygwin-ug-net/using-cygwinenv.html> (the section on "binmode")
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


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

- Raw text -


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