Date: Wed, 17 Oct 2001 15:52:33 +0200 From: Roman Neuhauser <neuhauser@mobil.cz> To: freebsd-questions@freebsd.org Subject: Re: sed question -- SOLVED Message-ID: <20011017155233.B30577@roman.mobil.cz> In-Reply-To: <20011017132807.C16050@roman.mobil.cz>; from neuhauser@mobil.cz on Wed, Oct 17, 2001 at 01:28:07PM %2B0200 References: <20011017132807.C16050@roman.mobil.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
> Date: Wed, 17 Oct 2001 13:28:07 +0200 > From: Roman Neuhauser <neuhauser@mobil.cz> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011017155233.B30577>