This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stop cygwin sed adding ^M


On Wed, Jan 23, 2002 at 07:14:18PM +0100, Corinna Vinschen wrote:
>On Wed, Jan 23, 2002 at 12:54:42PM -0500, Chris Faylor wrote:
>> On Wed, Jan 23, 2002 at 03:58:57PM +0100, Schaible, Jorg wrote:
>> >May be you should read the FAQ regarding text mounts ??
>> 
>> sed is a fully ported utility.  It is supposed to read CRLF text on
>> standard input and produce only UNIX-style newline endings on standard
>> output.
>
>There's one situation I know that it actually converts LF to CRLF.
>
>Say, you have a file foo:
>
>$ od -c foo
>0000000   h   a   l   l   o  \n
>0000006
>
>and your currently in a textmode mounted directory, then
>
>$ sed -e 's/ll/nn/' foo > bar
>
>creates actually a CRLF file bar:
>
>$ od -c bar
>0000000   h   a   n   n   o  \r  \n
>0000007
>
>and that's defined behaviour.  That isn't even going on in sed.
>The stdio redirection has already happened in the shell and sed
>is just using that file descriptor.

I stand corrected.

Sorry for the misinformation.

cgf

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]