Cool Bash Script to download APNotes
AndrewTheArt
Posted: Apr 27 2008, 05:07 PM


Newbie


Group: Members
Posts: 3
Member No.: 376
Joined: 27-April 08



Hey guys,

If anybody here uses Linux/Unix, then they can take advantage of this cool Bash script I made to download all the APNotes chatpers (1-41) into one massive text file.

You need to have Lynx installed for this to work - in Ubuntu, just type -

CODE
sudo apt-get install lynx


Here are the one-liners you can paste in your terminal to get the notes-

One massive text file with all chapters

CODE
for i in $(seq 1 41); do lynx -dump http://www.apnotes.net/ch${i}.html >> ApNotesAllChapters.txt; done;


Individual text files for each chapter

CODE
for i in $(seq 1 41);do lynx -dump http://www.apnotes.net/ch${i}.html >> Ch${i}APNotes.txt; done;


Here are the"script" versions of the above (basically just prettier formatting)

One massive text file with all chapters

CODE
#/bin/bash
for i in $(seq 1 41);
do
lynx -dump http://www.apnotes.net/ch${i}.html >> ApNotesAllChapters.txt;
done


Individual text files for each chapter

CODE
#/bin/bash
for i in $(seq 1 41);
do
lynx -dump http://www.apnotes.net/ch${i}.html >> Ch${i}.txt;
done


Enjoy, and give me credit if you post this elsewhere, please biggrin.gif biggrin.gif biggrin.gif

- Andrew
Top
« Next Oldest | Technical | Next Newest »


Topic Options



Hosted for free by InvisionFree (Terms of Use: Updated 7/7/05) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.0406 seconds | Archive