From owner-freebsd-questions Mon May 11 00:55:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id AAA29708 for freebsd-questions-outgoing; Mon, 11 May 1998 00:55:50 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from freebie.lemis.com (freebie.lemis.com [139.130.136.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA29703 for ; Mon, 11 May 1998 00:55:45 -0700 (PDT) (envelope-from grog@lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id RAA20300; Mon, 11 May 1998 17:25:40 +0930 (CST) (envelope-from grog) Message-ID: <19980511172540.B20153@freebie.lemis.com> Date: Mon, 11 May 1998 17:25:40 +0930 From: Greg Lehey To: Andrew Specht , freebsd-questions@FreeBSD.ORG Subject: Re: sed??? References: <036c01bd7ca9$257ce020$e34a05cb@alpine.iaccess> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <036c01bd7ca9$257ce020$e34a05cb@alpine.iaccess>; from Andrew Specht on Mon, May 11, 1998 at 04:50:55PM +1000 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 11 May 1998 at 16:50:55 +1000, Andrew Specht wrote: > Hi > > I'm trying to figure out how to substitute multiple spaces from a text file > with a single space using sed. > > this didn't work: > > sed /[" "]+//s//[" "]/ test No, it wouldn't. sed 's: *: :g' test Those are three spaces before the *; the first two because that's the minimum you want to consider changing, and the third one because there's no + operator in sed. Greg -- See complete headers for address and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message