From owner-freebsd-questions@FreeBSD.ORG Sat Feb 7 01:18:08 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 9621B106564A for ; Sat, 7 Feb 2009 01:18:08 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from imedmobility.com (host-50.216-16-29.iw.net [216.16.29.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6DEDE8FC23 for ; Sat, 7 Feb 2009 01:18:08 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from midco.net (host-47-73-107-208.midco.net [208.107.73.47]) by imedmobility.com (Postfix) with ESMTP id B21731173CA1 for ; Fri, 6 Feb 2009 19:18:07 -0600 (CST) Message-ID: <498CE14A.1090505@gmail.com> Date: Sat, 07 Feb 2009 01:18:02 +0000 From: Adam Vande More User-Agent: Thunderbird 2.0.0.18 (X11/20081225) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <498CBEBE.7080702@gmail.com> <20090206225619.GA75180@dan.emsphone.com> <498CC0FC.1040706@gmail.com> <20090206232129.GB75180@dan.emsphone.com> <498CCBA9.6010207@gmail.com> <498CCC94.6080507@gmail.com> <498CCE9C.3060200@ibctech.ca> In-Reply-To: <498CCE9C.3060200@ibctech.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 01:18:08 -0000 Steve Bertrand wrote: > Adam Vande More wrote: > > >>> I also tried escaping ( ) . / to no avail. >>> >> nevermind I see I have to \\ that as well. Okay now I'm going to try to >> find a way to do this with find and xargs >> > > IMHO, this has become a job for Perl :) > > Steve > Thanks for help everyone. My final command was this: skynet1# find . -name 'filename.php' | xargs sed -i.old -e '37a\\ include("/usr/home/www/imp-sites/default_inventory.php");' I used double quotes because I couldn't finger out how to the single quote. Good enough for me.