/[scripts]/trunk/mailman2mbox.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/mailman2mbox.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 41 - (hide annotations)
Thu Jul 26 17:17:54 2007 UTC (16 years, 8 months ago) by dpavlin
File MIME type: application/x-sh
File size: 630 byte(s)
support for uncompressed mailman archives

1 dpavlin 6 #!/bin/sh
2    
3     if [ -z "$1" ] ; then
4     echo "usage: $0 [URL to mailman list]"
5     exit 1
6     fi
7    
8     url=$1
9 dpavlin 41 name=`echo $url | sed -e 's!^.*/pipermail/!!' -e 's!/!!g'`
10 dpavlin 6
11 dpavlin 41 if [ -e $name ] ; then
12     echo "$name allready exists!"
13     exit 1
14     fi
15    
16 dpavlin 6 wget="-N -nd -nH"
17    
18 dpavlin 41 mkdir /tmp/$name || exit
19     cd /tmp/$name
20 dpavlin 6
21 dpavlin 41 wget -O index.html $wget $url
22 dpavlin 6
23 dpavlin 41 echo -n > $name
24    
25     grep \.txt index.html | cut -d\" -f2 | while read file ; do
26 dpavlin 6 echo "downloading $url/$file"
27     wget $wget "$url/$file"
28 dpavlin 41 if echo $file | grep '\.gz$' >/dev/null ; then
29     cat=zcat
30     else
31     cat=cat
32     fi
33     $cat $file | perl -pe 's/^(From.+?) at (.+)$/$1\@$2/g' >> $name
34 dpavlin 6 done
35 dpavlin 41
36     echo "Files left in /tmp/$name/$name"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26