From owner-freebsd-questions@FreeBSD.ORG Fri Feb 6 23:17:48 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 967501065670 for ; Fri, 6 Feb 2009 23:17:48 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: from ibctech.ca (v6.ibctech.ca [IPv6:2607:f118::b6]) by mx1.freebsd.org (Postfix) with SMTP id 30E388FC13 for ; Fri, 6 Feb 2009 23:17:48 +0000 (UTC) (envelope-from steve@ibctech.ca) Received: (qmail 8087 invoked by uid 89); 6 Feb 2009 23:18:06 -0000 Received: from unknown (HELO ?IPv6:2607:f118::5?) (steve@ibctech.ca@2607:f118::5) by v6.ibctech.ca with ESMTPA; 6 Feb 2009 23:18:05 -0000 Message-ID: <498CC514.1000905@ibctech.ca> Date: Fri, 06 Feb 2009 18:17:40 -0500 From: Steve Bertrand User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Adam Vande More References: <498CBEBE.7080702@gmail.com> <20090206225619.GA75180@dan.emsphone.com> <498CC0FC.1040706@gmail.com> In-Reply-To: <498CC0FC.1040706@gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Dan Nelson , freebsd-questions@freebsd.org Subject: Re: insert new line in files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2009 23:17:49 -0000 Adam Vande More wrote: > Dan Nelson wrote: >> You want: >> >> sed -e '5i\ >> test' test.txt >> >> i.e. a linebreak after the backslash. >> >> > I had actually tried that too: > >> sed -e '5i\ > ? test' text.txt > sed: 1: "5i > test > ": command i expects \ followed by text Try: # sed -e "5i\\ ? test" text.txt Note the double-quotes and two \\. I just ran into this today ;) Steve