This is the mail archive of the cygwin 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: 2.10.0: Cygwin now can not work well with a file in dos format.


On 2018-06-15 09:11, Soegtrop, Michael wrote:
> what has been changed in sed and awk is handling of carriage returns. The sed
> and awk of older Cygwin version strip \r from the input. Newer versions 
> behave like the same tools on Linux and don't strip CR. This is documented
> in the release notes, intended behavior and has been discussed quite
> extensively on the list (I complained about the same issue some-time last
> year).> The options you have is either to strip the \r characters away first (e.g.
> using tr) or to compile old versions of awk and/or sed from sources.
Use sed commands:

	$ sed -e 's/\r$//' ...		# strip input \r
	$ sed ... -e 's/$/\r/' ...	# insert output \r

or awk options:

	$ awk -v RS='\r?\n'		# strip input \r
	$ awk -v ORS='\r\n'		# insert output \r

to work the same on any system.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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