From owner-freebsd-questions@FreeBSD.ORG Thu Mar 12 18:05:57 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 C2C441065675 for ; Thu, 12 Mar 2009 18:05:57 +0000 (UTC) (envelope-from kstewart@owt.com) Received: from smtp.owt.com (smtp.owt.com [66.119.213.2]) by mx1.freebsd.org (Postfix) with ESMTP id 96D7A8FC15 for ; Thu, 12 Mar 2009 18:05:57 +0000 (UTC) (envelope-from kstewart@owt.com) Received: from kstewart2.owt.com (kstewart2.owt.com [64.146.237.228]) (authenticated bits=0) by smtp.owt.com (8.13.8/8.13.8) with ESMTP id n2CI5ugi030963; Thu, 12 Mar 2009 11:05:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=owt.com; s=default; t=1236881156; bh=+UtdIDPowHeGjBu42B/Wa5/ayXBZgUJXdNkW0FwcIy8=; h=From:To:Subject:Date:Cc:References:In-Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id; b=Xog4mELjmJs6L IhmvnF3GZ/1BzJ0r4qasbsfmPk0t5USUdJt6F48S6QkgPqdAU23Y0Y4DQfM9rDNHwd5 1TufSPSDtP4lARKk9fVAYUIL8kX56sbB0X4qmEX/w87RfcKD4XO6OII182n1hdseWo5 r60VxR7GK4BLxf3pJJ0l4ZB0= From: Kent Stewart To: freebsd-questions@freebsd.org Date: Thu, 12 Mar 2009 11:05:55 -0700 User-Agent: KMail/1.9.10 References: <20090312173436.GA51898@skytracker.ca> In-Reply-To: <20090312173436.GA51898@skytracker.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903121105.56011.kstewart@owt.com> Cc: David Banning Subject: Re: sed error "unescaped newline inside substitute pattern" 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: Thu, 12 Mar 2009 18:05:58 -0000 On Thursday 12 March 2009 10:34:36 am David Banning wrote: > Here is the php line that gives the error; > > cat start_text | sed "s/--maintext--/$test/" > endtext > > give error; > > sed: 1: "s/--maintext--/ Comment ...": unescaped newline inside substitute > pattern > > where $test contains customer input from a website form > > There is something about the content of the text within the variable $test > that is causing the error. > > Any pointers would be helpful. Well, it might be because "test" is a command line function. Kent -- kent Stewart Richland, WA http://users.owt.com/kstewart/index.html