Local RFCs

Previous | Next

RFCs are important documents that explain how the internet works among other things. Fortunately RFC are freely available and can be downloaded with a script like this one:

#!/usr/bin/env bash

for n in {0..9000}; do
        if wget -q "$url$n.txt" &> /dev/null; then
            echo "Downloading $url$n.txt"
    ) &

    # download rfc's in batches of 10
    while test $(jobs -p | wc -w) -ge 10; do wait -n; done

I also define a function that opens RFCs like man-pages:

rfc() (
    [ -f $file ] && less $file || echo "Could not find RFC$1"

now rfc 20 will open RFC 20.