From owner-freebsd-questions@FreeBSD.ORG Sat Jul 5 15:23:39 2008 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 9411A1065677 for ; Sat, 5 Jul 2008 15:23:39 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: from smtp131.rog.mail.re2.yahoo.com (smtp131.rog.mail.re2.yahoo.com [206.190.53.36]) by mx1.freebsd.org (Postfix) with SMTP id 2DD858FC1D for ; Sat, 5 Jul 2008 15:23:38 +0000 (UTC) (envelope-from jimmy@mammothcheese.ca) Received: (qmail 90602 invoked from network); 5 Jul 2008 14:56:56 -0000 Received: from unknown (HELO ?72.138.160.206?) (jazzturk@rogers.com@72.138.160.206 with plain) by smtp131.rog.mail.re2.yahoo.com with SMTP; 5 Jul 2008 14:56:56 -0000 X-YMail-OSG: YAtVyw4VM1lnIghygpo4iSZApgYzTwEPUkc5zYEbcftroC1Y_roE1RKmZRqAR9bxMQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <486F8BB8.6040704@mammothcheese.ca> Date: Sat, 05 Jul 2008 10:56:56 -0400 From: James Bailie User-Agent: Thunderbird 2.0.0.14 (X11/20080629) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Sebastian_Tymk=F3w?= References: <692660060807050706i6e02fe04t840bc0a2aff1e8ae@mail.gmail.com> In-Reply-To: <692660060807050706i6e02fe04t840bc0a2aff1e8ae@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Sed in FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jimmy@mammothcheese.ca List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2008 15:23:39 -0000 Sebastian Tymków wrote: > I've tried with sed -e '/PATTERN/ a\ line' file but this did'n work. There > are many axamples in internet but none > of them work on FreeBSD. The inserted line needs to be on a separate physical line. sed -e '/PATTERN/a\ line' For /bin/csh, you need two backslashes because the shell recognizes backslashes inside single-quotes, which it shouldn't. -- James Bailie http://www.mammothcheese.ca