This is the mail archive of the
mailing list for the Cygwin project.
RE: awk strangely outputs to file
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- 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>
- Date: Fri, 7 Feb 2003 11:30:54 -0500 (EST)
- Subject: RE: awk strangely outputs to file
- Reply-to: cygwin at cygwin dot com
On Fri, 7 Feb 2003, Harald Kierer wrote:
> > From: Chiranth [mailto:firstname.lastname@example.org]
> > 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.
<http://cygwin.com/cygwin-ug-net/using-cygwinenv.html> (the section on "binmode")
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,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!
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html