On Jan 15, 2008 10:55 PM, Paul G. Allen <[EMAIL PROTECTED]> wrote:
> My brother's e-mail is not working so he can't respond himself (He is
> currently electronically crippled! Oh the humanity!! :o ). His e-mail
> not working is not related to this problem, it's a server problem (and
> unfortunately neither of us have root access in order to fix it).
>
> He said:
>
> "Actually, Carl's script works on the relevant field, but it has a side
> affect that corrupts other data. Specifically, a string of the form of
> "_n", where n is a hex number [0-1,a-f]. IOW, it doesn't limit the
> changes to the X-Mozilla-Status field."
>
> PGA
>
>
> Carl Lowenstein wrote:
>
> > oops Just found out that GNU sed version 4.1.2 doesn't understand
> > :xdigit:.
> > Medium-clumsy sed script:
> > - - - - - - - -
> > /\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)\([89a-f]\)/s//\1_\2/
> > # split off last digit
> > s/_8/0/ # clear the "8" bit, remove the _
> > splitting character
> > s/_9/1/
> > s/_a/2/
> > s/_b/3/
> > s/_c/4/
> > s/_d/5/
> > s/_e/6/
> > s/_f/7/
> > /^/p # print all lines
> > - - - - - - - -
Don't understand. Oh, yes, maybe I do. There are other lines that
have _[89abcdef] in them. Didn't think of that first time around.
Just repeat the whole test 8 times for lines that begin with
X-Mozilla-Status: 3 hex digits 89abcdef. And replace the individual
characters with 01234567.
[EMAIL PROTECTED] dallen]$ cat sedscr
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)8/s//\10/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)9/s//\11/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)a/s//\12/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)b/s//\13/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)c/s//\14/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)d/s//\15/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)e/s//\16/
/\(^X-Mozilla-Status: [0-9a-f][0-9a-f][0-9a-f]\)f/s//\17/
/^/p
Slightly messy, but can be constructed without too much editor
flapping. I think I could write it in fewer lines with gawk, but
won't try.
carl
--
carl lowenstein marine physical lab u.c. san diego
[EMAIL PROTECTED]
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list