From owner-freebsd-questions@FreeBSD.ORG Fri Mar 13 16:25:34 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96120106568C for ; Fri, 13 Mar 2009 16:25:34 +0000 (UTC) (envelope-from david+dated+1237392898.23652b@skytracker.ca) Received: from 3s1.com (3s1.com [209.161.205.12]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFE08FC22 for ; Fri, 13 Mar 2009 16:25:33 +0000 (UTC) (envelope-from david+dated+1237392898.23652b@skytracker.ca) Received: from 3s1.com (localhost [127.0.0.1]) by 3s1.com (8.13.8/8.13.8) with ESMTP id n2DGExJe079351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 13 Mar 2009 12:15:00 -0400 (EDT) (envelope-from david+dated+1237392898.23652b@skytracker.ca) Received: (from david@localhost) by 3s1.com (8.13.8/8.14.1/Submit) id n2DGEx1p079350 for questions@freebsd.org; Fri, 13 Mar 2009 12:14:59 -0400 (EDT) (envelope-from david+dated+1237392898.23652b@skytracker.ca) X-Authentication-Warning: 3s1.com: david set sender to david+dated+1237392898.23652b@skytracker.ca using -f Received: from [192.168.1.17] (seventeen [192.168.1.17]) by 3s1.com (tmda-ofmipd) with ESMTP; Fri, 13 Mar 2009 12:14:48 -0400 Message-ID: <49BA8716.4040803@skytracker.ca> Date: Fri, 13 Mar 2009 12:17:26 -0400 User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Nikos Vassiliadis References: <20090312173436.GA51898@skytracker.ca> <49BA278D.5080800@gmx.com> <49BA6DBD.2010304@skytracker.ca> <49BA838D.8010703@gmx.com> In-Reply-To: <49BA838D.8010703@gmx.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: David Banning X-Virus-Scanned: ClamAV 0.94.2/9105/Fri Mar 13 07:58:59 2009 on 3s1.com X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on 3s1.com Cc: questions@freebsd.org 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: Fri, 13 Mar 2009 16:25:35 -0000 > > Don't you have control over this web form??? That's the place > you should filter your input... The sooner you do the filtering > the better. > > Anyway, you could also use an intermediate variable that replaces > all newlines with spaces. > > # a="This > > is > > the > > input > > from the > > web server" > # b=`echo $a` > # sed "s/foo/$b/" > foo > This is the input from the web server > ^D# > > I hope you won't go that route though... Nikos > Yes - I have control of that - so I could filter out the problem in php. The only problem is that I don't know what I am filtering. If I know exactly what the erroneous characters are I could filter them - I have looked at the file in vi but the problematic characters are invisible there.