Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jan 2002 08:56:19 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Zach Garner <zach@neurosoft.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Sed compatibility with GNU Sed
Message-ID:  <20020130065619.GB44590@hades.hell.gr>
In-Reply-To: <1011828158.44952.4.camel@minsky.zachgarner.com>
References:  <1011828158.44952.4.camel@minsky.zachgarner.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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' <foo
> 
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020130065619.GB44590>