Re: sed error "unescaped newline inside substitute pattern"

2009-03-14 Thread Mike Clarke
On Friday 13 March 2009, David Banning wrote: > 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 th

Re: sed error "unescaped newline inside substitute pattern"

2009-03-13 Thread David Banning
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

Re: sed error "unescaped newline inside substitute pattern"

2009-03-13 Thread Nikos Vassiliadis
David Banning wrote: I have looked at the file in vi but the problematic characters are invisible there. The problematic character is the newline character, \n, ASCII 0xA. And, yes vi is old but it's a few months now that it supports newlines without problems;) Nikos __

Re: sed error "unescaped newline inside substitute pattern"

2009-03-13 Thread Nikos Vassiliadis
David Banning wrote: Nikos Vassiliadis wrote: 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

Re: sed error "unescaped newline inside substitute pattern"

2009-03-13 Thread David Banning
Nikos Vassiliadis wrote: 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

Re: sed error "unescaped newline inside substitute pattern"

2009-03-13 Thread Nikos Vassiliadis
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 ab

Re: sed error "unescaped newline inside substitute pattern"

2009-03-12 Thread Frank Shute
On Thu, Mar 12, 2009 at 01:34:36PM -0400, 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 cont

Re: sed error "unescaped newline inside substitute pattern"

2009-03-12 Thread David Banning
> Well, it might be because "test" is a command line function. It actually doesn't matter whether I use the word "test" or any other word as a variable ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ques

Re: sed error "unescaped newline inside substitute pattern"

2009-03-12 Thread Kent Stewart
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 custom

sed error "unescaped newline inside substitute pattern"

2009-03-12 Thread David Banning
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