[Chugalug] UTF8 Trick

James Nylen jnylen at gmail.com
Wed Jun 26 13:39:49 UTC 2013


Oops, take out the echo in that last command.  I'll quit replying now :)


On Wed, Jun 26, 2013 at 9:38 AM, James Nylen <jnylen at gmail.com> wrote:

> You could simplify that a little:
>
> grep --color='auto' -P -n "[\x80-\xFF]" Maildir/cur/*
> grep -P -l -Z "[\x80-\xFF]" Maildir/cur/* | xargs -0 echo rm
>
>
> On Wed, Jun 26, 2013 at 8:15 AM, Mike Harrison <cluon at geeklabs.com> wrote:
>
>>
>> I've been doing this for a few months now, watching it run, and I've been
>> amazed by the accuracy of this trick. The people I normally would want to
>> talk to on this address, don't send mail with UTF8 characters. I run this
>> before pulling up pine via shell to read my mail.
>>
>> A simple shell in my user directory:
>>
>> grep --color='auto' -P -n "[\x80-\xFF]" Maildir/cur/*
>> grep  -P "[\x80-\xFF]" Maildir/cur/* >bad
>> perl ./nukebad.pl
>>
>> Nukebad is simple:
>>
>> #!/usr/bin/perl
>> open(IN,"bad") ; while(<IN>){
>>  $filename = substr($_,0,70) ;
>>  print "Nuking $filename\n" ;
>>  unlink("$filename*") ; } ;
>>
>>
>>
>> ______________________________**_________________
>> Chugalug mailing list
>> Chugalug at chugalug.org
>> http://chugalug.org/cgi-bin/**mailman/listinfo/chugalug<http://chugalug.org/cgi-bin/mailman/listinfo/chugalug>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://chugalug.org/pipermail/chugalug/attachments/20130626/3c088466/attachment.html>


More information about the Chugalug mailing list