From owner-freebsd-questions@FreeBSD.ORG Sun May 20 16:22:12 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4365C1065670 for ; Sun, 20 May 2012 16:22:12 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (mx-out.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id DD64E8FC17 for ; Sun, 20 May 2012 16:22:11 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id q4KGNmXS096669; Sun, 20 May 2012 11:23:48 -0500 (CDT) Date: Sun, 20 May 2012 11:23:48 -0500 (CDT) From: Robert Bonomi Message-Id: <201205201623.q4KGNmXS096669@mail.r-bonomi.com> To: bluethundr@gmail.com, freebsd-questions@freebsd.org In-Reply-To: Cc: Subject: Re: eliminate character with sed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 16:22:12 -0000 > From owner-freebsd-questions@freebsd.org Sun May 20 11:11:00 2012 > Date: Sun, 20 May 2012 12:08:04 -0400 > From: Tim Dunphy > To: freebsd-questions > Subject: eliminate character with sed > > Hello list, > > I have a few php config files that have the windows delimiter > character in them ('^M') that I would like to get rid of. I'm trying > to use sed to do it, and for some reason I am not having any luck. > > Here's the line that I'm trying to use: > > #sed -i '.bak' 's/^M//g' config.php ^^ || I strongly suspect that you are typing '^M' as _two_ characters, literally a "^" and an "M". _THAT_ won't work. You need to type a "[CTL]V", followed by a [CTL]M, to get the right magic in the sed command HOWEVER, it is far easier to simply use: tr -d "\r" new