On Wed, Sep 10, 2008 at 10:10:20AM +0200, "Plüm, Rüdiger, VF-Group" wrote:
>  
> 
> > -----Ursprüngliche Nachricht-----
> > Von: [EMAIL PROTECTED] 
> > Gesendet: Mittwoch, 10. September 2008 08:56
> > An: dev@httpd.apache.org
> > Betreff: Re: svn commit: r691418 [2/2] - in 
> > /httpd/httpd/trunk: ./docs/manual/mod/ modules/filters/
> > 
> 
> > I investigated further. I wrote a test file having binary 
> > character from 0 to 31:
> > $ od -c out.txt
> > 0000000  \0  \n 001  \n 002  \n 003  \n 004  \n 005  \n 006  
> > \n 007  \n
> > 0000020  \b  \n  \t  \n  \n  \n 013  \n  \f  \n  \r  \n 016  
> > \n 017  \n
> > ...
> > 
> > And a small sed script :
> >  $ cat one.sed
> > l
> > d
> > 
> > Sed script just runs the "l" command for each line.
> > $ /usr/ucb/sed -f one.sed out.txt  > out1.txt
> > 
> > Here is the output of out1.txt
> > $ od -c out1.txt
> > 0000000  \n   \   0   1  \n   \   0   2  \n   \   0   3  \n   
> > \   0   4
> > 0000020  \n   \   0   5  \n   \   0   6  \n   \   0   7  \n   
> > -  \b   <
> > 0000040  \n   -  \b   >  \n  \n  \n   \   1   3  \n   \   1   
> > 4  \n   \
> > 0000060   1   5  \n   \   1   6  \n   \   1   7  \n   \   2   
> > 0  \n   \
> > ...
> > 
> > $ cat out1.txt
> > \01
> > \02
> > \03
> > \04
> > \05
> > \06
> > \07
> > <
> > >
> > 
> > 
> > \13
> > \14
> > 
> > -------------------------------------------
> > 
> > So for some strange reason :
> > 0x8 is converted to "-\b<" and
> > 0x9 is converted to "-\b>"
> > 
> > That's what we see in "trans" variable.
> > 
> > Do you think it could be a bug in original sed and should we 
> > correct it? 
> 
> I guess it is a bug in original sed and it should be corrected.
> IMHO it should be suffient to replace
> 
> -\b<
> 
> and
> 
> -\b<
> 
> with
> 
> <
> 
> and
> 
> >
Can you elaborate why you chose "<" and ">". I could not think of any
reasons behind it.
sed's man page says :
    (2)l            List the pattern space on the standard  out-
                     put  in  an  unambiguous  form. Non-printing
                     characters are spelled in  two  digit  ASCII
                     and long lines are folded.

So 0x8 and 0x9 char values, which I believe are non printable characters,
should be printed into *two* digit ASCII. So \10 and \11 looks to me
as conforming to man page.

Regards,
Basant.

Reply via email to