From owner-freebsd-questions@FreeBSD.ORG Sat Aug 28 02:52:06 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7FF216A4CE for ; Sat, 28 Aug 2004 02:52:06 +0000 (GMT) Received: from smtp100.rog.mail.re2.yahoo.com (smtp100.rog.mail.re2.yahoo.com [206.190.36.78]) by mx1.FreeBSD.org (Postfix) with SMTP id 2442E43D55 for ; Sat, 28 Aug 2004 02:52:06 +0000 (GMT) (envelope-from Mike.Jeays@rogers.com) Received: from unknown (HELO ?192.168.2.100?) (mjeays2551@24.43.93.57 with plain) by smtp100.rog.mail.re2.yahoo.com with SMTP; 28 Aug 2004 02:52:05 -0000 From: Mike Jeays To: f-questions In-Reply-To: <20040828004618.GA2856@moo.holy.cow> References: <34b425c50408271652314776b1@mail.gmail.com> <20040828004618.GA2856@moo.holy.cow> Content-Type: text/plain Organization: Message-Id: <1093661524.743.111.camel@chaucer> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 27 Aug 2004 22:52:04 -0400 Content-Transfer-Encoding: 7bit cc: Soo-Hyun Choi Subject: Re: vi editor related question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2004 02:52:06 -0000 On Fri, 2004-08-27 at 20:46, Parv wrote: > in message <34b425c50408271652314776b1@mail.gmail.com>, wrote > Soo-Hyun Choi thusly... > > > > I edit ... certain text editor under Windows XP, and then I open > > ... using vi editor under FreeBSD. Then, there are bunch of "^M" > > sign at the end of each line. Does anyone know why this is > > happening? > > Cause is the default line ending on Windows being different than on > Unix/FreeBSD. > > > > And, does anyone can tell me how to avoid this kind of things? > > Use an editor on Windows that saves the file as w/ Unix line ending. > Or, use an editor on FreeBSD, like vim 6 from the ports, that will > hide/change '^M' characters. > > Other methods is to preprocess your files... > > http://groups.google.com/groups?q=remove+%5EM+file > http://groups.google.com/groups?q=remove+%5EM+group%3Acomp.* > > > > - Parv If you are using plain vi, you can get rid of the unwanted characters with the command :1,$s/ctrl-v-m//g where "ctrl-v-m' means hold down the Ctrl key while you press v followed by m. You will see them magically disappear.