Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2002 11:47:58 +0200
From:      "Patrick O'Reilly" <bsd@perimeter.co.za>
To:        "ann kok" <annkok2001@yahoo.com>, <questions@FreeBSD.ORG>
Subject:   Re: special charaters (return key)
Message-ID:  <021a01c1dbbd$d1ebadb0$b50d030a@PATRICK>
References:  <20020403204049.63482.qmail@web20104.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message -----
From: "ann kok" <annkok2001@yahoo.com>


> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?021a01c1dbbd$d1ebadb0$b50d030a>