From owner-freebsd-questions Mon Jul 14 11:43:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA07107 for questions-outgoing; Mon, 14 Jul 1997 11:43:10 -0700 (PDT) Received: from horton.iaces.com (root@horton.iaces.com [204.147.87.98]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA07095 for ; Mon, 14 Jul 1997 11:43:03 -0700 (PDT) Received: (from proot@localhost) by horton.iaces.com (8.8.5/8.8.4) id NAA06629; Mon, 14 Jul 1997 13:41:47 -0500 (CDT) From: "Paul T. Root" Message-Id: <199707141841.NAA06629@horton.iaces.com> Subject: Re: sed question To: vas@vas.tomsk.su (Victor A. Sudakov) Date: Mon, 14 Jul 1997 13:41:46 -0500 (CDT) Cc: questions@FreeBSD.ORG In-Reply-To: <199707141412.WAA00782@vas.tomsk.su> from "Victor A. Sudakov" at "Jul 14, 97 10:12:55 pm" X-Organization: !nterprise Networking Services - ACES X-Phone: (612) 663-1979 X-Fax: (612) 663-8030 X-Page: (800) SKY-PAGE PIN: 537-7270 X-Address: 200 S. 5th St., Suite 1100 X-Address: Minneapolis, MN 55402 X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In a previous message, Victor A. Sudakov said: > 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" sed "s/^J/ /g" should work. That's Ctl-J not ^J > > 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 > > -- I don't have the authority to approve that. --from "Excuses, Excuses" *the* compendium of excuses by Leigh W. Rutledge