From owner-freebsd-questions Wed Oct 17 6:48:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mobil.cz (nat3.mobil.cz [194.213.62.3]) by hub.freebsd.org (Postfix) with ESMTP id 6733937B403 for ; Wed, 17 Oct 2001 06:48:33 -0700 (PDT) Received: (from roman@localhost) by mobil.cz (8.11.6/8.11.6) id f9HDqYf36351 for freebsd-questions@freebsd.org; Wed, 17 Oct 2001 15:52:34 +0200 (CEST) (envelope-from neuhauser@mobil.cz) X-Authentication-Warning: roman.mobil.cz: roman set sender to neuhauser@mobil.cz using -f Date: Wed, 17 Oct 2001 15:52:33 +0200 From: Roman Neuhauser To: freebsd-questions@freebsd.org Subject: Re: sed question -- SOLVED Message-ID: <20011017155233.B30577@roman.mobil.cz> Mail-Followup-To: freebsd-questions@freebsd.org References: <20011017132807.C16050@roman.mobil.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011017132807.C16050@roman.mobil.cz>; from neuhauser@mobil.cz on Wed, Oct 17, 2001 at 01:28:07PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Date: Wed, 17 Oct 2001 13:28:07 +0200 > From: Roman Neuhauser > To: freebsd-questions@freebsd.org > Subject: sed question > > Hi there, > > can anyone tell me what's wrong with this command? > > > cat somefile | sed -E '~foobar~d' > sed: 1: "~foobar~d": invalid command code ~ > > sed(1) says: > > 1. In a context address, any character other than a backslash (``\'') > or newline character may be used to delimit the regular expression. > > TIA Sorry to bother everyone, I knew it'd be PEBKAC. In case someone else hits the same wall, here's how it works: 1. ~ has a special meaning for sed, a fact I was unaware of. 2. when you want to delimit the regular expression ('address') with something else than slashes, you have to backslash the _opening_ delimiter. Leave the closing one alone; you'll get "unterminated regular expression" otherwise. That's it. Happy sedding. :) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message