From owner-freebsd-questions Fri Apr 4 06:50:37 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id GAA11068 for questions-outgoing; Fri, 4 Apr 1997 06:50:37 -0800 (PST) Received: from gluon.mep.ruhr-uni-bochum.de (gluon.mep.ruhr-uni-bochum.de [134.147.160.165]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id GAA11059 for ; Fri, 4 Apr 1997 06:50:34 -0800 (PST) Received: (from roberte@localhost) by gluon.mep.ruhr-uni-bochum.de (8.6.12/8.6.12) id QAA11267; Fri, 4 Apr 1997 16:50:33 +0200 From: Robert Eckardt Message-Id: <199704041450.QAA11267@gluon.mep.ruhr-uni-bochum.de> Subject: Re: Removing DOS's ^M In-Reply-To: <199704041308.PAA00627@shire.domestic> from Joachim Kuebart at "4. Apr. 97 15:07:45" To: joki@shire.domestic (Joachim Kuebart) Date: Fri, 4 Apr 1997 16:50:33 +0200 (MET DST) Cc: questions@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by freefall.freebsd.org id GAA11062 Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > There used to be a utility to do that, something like a filter called crlf or so, but I can't find that. > > For now, to convert Text files (that do NOT contain any other control characters apart from ^M and newline), you can use > > cat -v filename | sed 's/^M//' > outfilename > > alternatively to EMACS, which is Eight Megabytes and Constantly Swapping. > Maybe even sed offers a better way, but this is what comes to my mind :-) Try tr -d '\r' outfilename ~~ = This will work also for files which contain other control chars. Robert -- Dr. Robert Eckardt ( Ruhr-Universitaet Bochum, Inst.f.Theor.Physik, NB6/169 ) Universitaetsstrasse 150, D-44780 Bochum, Germany ----X---8---- Telefon: +49 234 700-3709, Telefax: +49 234 7094-574 8 E-Mail: RobertE@MEP.Ruhr-Uni-Bochum.de --------8---- URL: http://WWW.MEP.Ruhr-Uni-Bochum.de/~roberte >>> To be successful one needs friends, <<< >>> To be very successful one needs enemies. <<<