December 23rd, 2010

A quick toy to fetch raw patches from spinics.net archives.

#!/bin/bash

wget "$1" -O - | sed -n '/<pre>/,/<\/pre>/b next;b;:next;s@</*pre>@@;s/&gt;/>/g;s/&lt;/</g;s/&quot;/"/;s/&amp;/\&/g;p'

Usable for example:

./rawfetch.sh http://www.spinics.net/lists/linux-nfs/msg18151.html > out1.patch

(I note that escaping the above sed expression so that it showed up properly in this livejournal post was almost as much work as writing it.)
  • Current Mood
    exhausted exhausted
  • Tags