for i in `grep -o "http://www.arduino.cc/en/Serial/[^']*" index.html | sort -u | grep -v '?'| cut -d '/' -f 6`;do curl http://www.arduino.cc/en/Serial/$i -o Serial_$i.html;done
perl -i -pe "s|http://www.arduino.cc/en/Reference/[^?\"']*\?[^'\"]*|#|g" *.html # replace links to unknown pages with links to '#'
perl -i -pe "s|http://www.arduino.cc/en/Reference/([^']*)|\1.html|g" *.html # replace links to remote reference with links to local reference
perl -i -pe "s|http://www.arduino.cc/en/Serial/([^']*)|Serial_\1.html|g" *.html # replace links to remove serial reference with links to local serial reference