I don't think that sed/sh is the answer. I'd use Perl. Basically you can write a smart regex to detect an equal sign followed by a hex code. The regex should capture the hex code. From the trapped code, you could use the chr() function to replace the value (0x0a = newline):
[root at lite src]# cat test.pl #!/usr/bin/perl print "==" . chr(0x0a) . "--\n"; [root at lite src]# perl test.pl == -- Ronnie Puryear Information Technology, LLC Baton Rouge, LA * 225-706-8414 http://www.puryear-it.com Visit http://www.puryear-it.com/pubs/ebooks/ to download your free copies of: "Best Practices for Managing Linux and UNIX Servers" "Spam Fighting and Email Security in the 21st Century" Fernando Vilas wrote: > On Friday 28 September 2007 10:48:00 Ronnie Gilkey wrote: > >> It's a MUA issue, I've seen it before. What happens is that some >> clients replace, or what they like to call "encoding", white-space or >> other items with "=<hex value>" (0x20 is hex for a space). It's a >> really bad "encoding scheme". >> >> Ronnie >> >> > > Yeah, I sort of figured they were the ASCII codes after the =, with the > exception of the newline, whenever they introduce a line break. Which could > be helpful when writing a filter to call from procmail. I'd prefer to find a > different way, since my sed/sh skills are somewhat lacking compared to my > C/C++ skills, but I'll script something if it's the easiest way. If you've > seen it before, maybe the script will be useful to others, so I'll share it. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > General mailing list > General at brlug.net > http://mail.brlug.net/mailman/listinfo/general_brlug.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.brlug.net/pipermail/general_brlug.net/attachments/20070928/75669f01/attachment.html
