Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Mar 2009 12:17:26 -0400
From:      David Banning <david+dated+1237392898.23652b@skytracker.ca>
To:        Nikos Vassiliadis <nvass9573@gmx.com>
Cc:        questions@freebsd.org
Subject:   Re: sed error "unescaped newline inside substitute pattern"
Message-ID:  <49BA8716.4040803@skytracker.ca>
In-Reply-To: <49BA838D.8010703@gmx.com>
References:  <20090312173436.GA51898@skytracker.ca> <49BA278D.5080800@gmx.com> <49BA6DBD.2010304@skytracker.ca> <49BA838D.8010703@gmx.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49BA8716.4040803>