From owner-freebsd-questions Mon Jul 14 15:30:26 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id PAA18508 for questions-outgoing; Mon, 14 Jul 1997 15:30:26 -0700 (PDT) Received: from socrates.i-pi.com (socrates.i-pi.com [198.49.217.5]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA18442 for ; Mon, 14 Jul 1997 15:30:01 -0700 (PDT) Received: (from ingham@localhost) by socrates.i-pi.com (8.8.5/8.8.5) id QAA01628; Mon, 14 Jul 1997 16:27:17 -0600 (MDT) Message-ID: <19970714162717.58653@socrates.i-pi.com> Date: Mon, 14 Jul 1997 16:27:17 -0600 From: Kenneth Ingham To: "Victor A. Sudakov" Cc: questions@FreeBSD.ORG Subject: Re: sed question References: <199707141412.WAA00782@vas.tomsk.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.74 In-Reply-To: <199707141412.WAA00782@vas.tomsk.su>; from Victor A. Sudakov on Mon, Jul 14, 1997 at 10:12:55PM +0800 Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk You could also use tr: tr '\n' ' ' Kenneth On Mon, Jul 14, 1997 at 10:12:55PM +0800, Victor A. Sudakov wrote: > Hello. > > I understand that my question is not FreeBSD specific, it is rather generic. > However, there are so many unix gurus here ;-) > > So, if I want to replace newlines in a file with spaces, it would be natural > to run such a sed script: > > sed "s/\n/ /g" > > However it does not work and it should not work, as the man page states, > that the newline characters are not allowed in replacement strings. > > So, what should I do? > > And a related question: is there any good source of information on sed? > Probably with examples? The thing seems to be very powerful and I wish to > learn it, but the man page is too spartan. > > Thanks a lot. > > -- > Victor Sudakov > http://www.tomsk.su/r/persons/vas.htm