From owner-freebsd-questions Tue Jan 29 22:56:28 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 66C1537B416 for ; Tue, 29 Jan 2002 22:56:25 -0800 (PST) Received: from hades.hell.gr (patr530-a142.otenet.gr [212.205.215.142]) by mailsrv.otenet.gr (8.12.2/8.12.2) with ESMTP id g0U6uLC1001381; Wed, 30 Jan 2002 08:56:22 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id g0U6uKV44930; Wed, 30 Jan 2002 08:56:20 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Wed, 30 Jan 2002 08:56:19 +0200 From: Giorgos Keramidas To: Zach Garner Cc: freebsd-questions@freebsd.org Subject: Re: Sed compatibility with GNU Sed Message-ID: <20020130065619.GB44590@hades.hell.gr> References: <1011828158.44952.4.camel@minsky.zachgarner.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1011828158.44952.4.camel@minsky.zachgarner.com> User-Agent: Mutt/1.3.25i 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 On 2002-01-23 17:22:38, Zach Garner wrote: > In GNU Sed (textproc/gsed), I can execute the following command which > will insert "asdf" on the first line of the contents of file foo: > gsed -e '1i\' -e 'asdf' > This does not work in the sed that comes with FreeBSD. Instead, the only > way I have been able to do the above is by separating the command on two > lines: > sed -e '1i\ > asdf' < foo Shell quotes are probably bitting you. But what you are trying to do is easy to emulate with: ( echo asdf ; cat foo ) -- Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org} FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/ FreeBSD: The power to serve . . . . http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message