Re^2: end of line character

Guy Harris guy at auspex.auspex.com
Tue Jul 11 04:35:22 AEST 1989


>	% cat todos
>	#!/bin/sed -f
>	s/$/^M/

(Where "^M" stands for "a control-M", not for "'^' followed by 'M'", of
course.)

>	% cat fromdos
>	#!/bin/sed -f
>	s/.$//

Or

	#!/bin/sh -
	tr -d '\015\032'

if you want to rip extraneous ^Zs out as well.

>	cr="`ctrl M`"

You forgot to supply the "ctrl" command - it's not a standard part of S5
(I couldn't find it, anyway).  The same

	sed 's/$/^M/'

trick should work in S5 as well.



More information about the Comp.unix.questions mailing list