From owner-freebsd-questions Wed Nov 8 14:47:58 2000 Delivered-To: freebsd-questions@freebsd.org Received: from relay.intercom.es (relay.intercom.es [212.66.160.20]) by hub.freebsd.org (Postfix) with ESMTP id AADC537B479 for ; Wed, 8 Nov 2000 14:47:55 -0800 (PST) Received: from lix.intercom.es (root@lix.intercom.es [212.66.160.2]) by relay.intercom.es (8.9.3/8.9.3) with ESMTP id WAA07303; Wed, 8 Nov 2000 22:30:15 +0100 Received: from intercom.es (iv2-40.intercom.es [212.66.169.40]) by lix.intercom.es (8.9.3/8.9.3) with ESMTP id XAA24794; Wed, 8 Nov 2000 23:28:45 +0100 Received: (from megarcia@localhost) by intercom.es (8.11.0/8.11.0) id eA8Mn8W02675; Wed, 8 Nov 2000 23:49:08 +0100 (CET) (envelope-from megarcia) Date: Wed, 8 Nov 2000 23:49:08 +0100 From: Manuel Enrique Garcia Cuesta To: Len Conrad Cc: freebsd-questions@FreeBSD.ORG Subject: Re: a little help with sed Message-ID: <20001108234908.D776@ilex.kicelo.org> References: <5.0.0.25.0.20001108232905.02799040@mail.Go2France.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: <5.0.0.25.0.20001108232905.02799040@mail.Go2France.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Len, === Len Conrad escribia (Wed, Nov 08, 2000 at 11:32:55PM +0100): > I'd like to remove \n and concat two lines when the last word of > first line is a certain value but all of my reading and playing has > only gotten me to this non-working "concept" : > > sed -e s/"lastword"\n/"lastword"/g newfile > > any sedistas care to take a shot? bash-2.04$ sed '/lastword$/{ N s/\n// }' < oldfile > newfile > > Tks, HTH Manuel Garcia To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message