sed error "unescaped newline inside substitute pattern"
jmc-freebsd2 at milibyte.co.uk
Sat Mar 14 03:04:57 PDT 2009
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 the problematic characters
> are invisible there.
Would the php addcslashes() function do what you need?
$in = "This
$out = addcslashes($in,"\n");
This results in:
string(42) "This\nis\nthe\ninput\nfrom the\nweb server"
More information about the freebsd-questions