From owner-freebsd-questions Thu Apr 4 1:50:19 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dns.perimeter.co.za (dns.perimeter.co.za [196.25.164.254]) by hub.freebsd.org (Postfix) with ESMTP id 74BAB37B400 for ; Thu, 4 Apr 2002 01:50:12 -0800 (PST) Received: from PATRICK (loopback.mipjhb [209.212.102.245] (may be forged)) by dns.perimeter.co.za (8.11.1/8.11.1) with SMTP id g349ne594217; Thu, 4 Apr 2002 11:49:41 +0200 (SAST) (envelope-from bsd@perimeter.co.za) Message-ID: <021a01c1dbbd$d1ebadb0$b50d030a@PATRICK> From: "Patrick O'Reilly" To: "ann kok" , References: <20020403204049.63482.qmail@web20104.mail.yahoo.com> Subject: Re: special charaters (return key) Date: Thu, 4 Apr 2002 11:47:58 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ----- Original Message ----- From: "ann kok" > Hi all > > how do type the special charater? ^M (return key) > I want to remove it on the file > > eg [root@ann work1]# cat -v crt2.txt > test^M > a^M > b^M > c^M > d^M > e^M > > sed 's/^M//g' crt1.txt > In this particular case (DOS text files moved onto UNIX), I just do this: sed 's/.$//g' file.txt It's the lazy way, but it works in _this_specific_case_ . Patrick. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message