From owner-freebsd-questions@FreeBSD.ORG Sat Feb 7 10:26:29 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 A8E85106566B for ; Sat, 7 Feb 2009 10:26:29 +0000 (UTC) (envelope-from jmc-freebsd2@milibyte.co.uk) Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by mx1.freebsd.org (Postfix) with ESMTP id 3C1B78FC0A for ; Sat, 7 Feb 2009 10:26:28 +0000 (UTC) (envelope-from jmc-freebsd2@milibyte.co.uk) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAH7pjEnUnw6U/2dsb2JhbADOB4QaBg Received: from fhw-relay07.plus.net ([212.159.14.148]) by relay.ptn-ipout02.plus.net with ESMTP; 07 Feb 2009 09:57:14 +0000 Received: from [84.92.153.232] (helo=curlew.milibyte.co.uk) by fhw-relay07.plus.net with esmtp (Exim) id 1LVjw2-00048D-M1 for freebsd-questions@freebsd.org; Sat, 07 Feb 2009 09:57:14 +0000 Received: by curlew.milibyte.co.uk with local (Exim 4.69) (envelope-from ) id 1LVjw1-0000rF-RW for freebsd-questions@freebsd.org; Sat, 07 Feb 2009 09:57:14 +0000 From: Mike Clarke To: freebsd-questions@freebsd.org Date: Sat, 7 Feb 2009 09:57:13 +0000 User-Agent: KMail/1.9.10 References: <498CBEBE.7080702@gmail.com> <20090206232129.GB75180@dan.emsphone.com> <498CCBA9.6010207@gmail.com> In-Reply-To: <498CCBA9.6010207@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902070957.13650.jmc-freebsd2@milibyte.co.uk> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jmc-freebsd2@milibyte.co.uk X-SA-Exim-Scanned: No (on curlew.milibyte.co.uk); SAEximRunCond expanded to false X-Plusnet-Relay: 69c0b98667b7d58287ba7b3bac90112d 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: Sat, 07 Feb 2009 10:26:30 -0000 On Friday 06 February 2009, Adam Vande More wrote: > Progress is being made as it works in the test now with the \\ > however I'm running into more things I don't understand in regards to > what I need to escape in my input string. Whether to use \ or \\ will depend on your shell. You can avoid dependence on the shell by using a sed script, e.g. curlew:/tmp% cat test.txt 1 2 3 4 5 6 curlew:/tmp% cat test.sed #! /usr/bin/sed -f 5i\ test curlew:/tmp% ./test.sed test.txt 1 2 3 4 test 5 6 -- Mike Clarke