來自:樹雄
時間:Tue Jun 08 01:46:58 2010
來自:ywsing0
時間:Sat Jun 05 00:17:29 2010利用 bash shell script 下載金庸小說
URL=http://www.cnnovels.net/wx/jingyong/
NOVELS="ffwz xsfh lcj tlbb sdyxz horse ldj xajh sjc eagle xkx yttlj bxj yyd"for NOVEL in $NOVELS; do
(
mkdir $NOVEL && cd $NOVEL &&
for LINK in $(
wget -O - $URL/$NOVEL -q |
grep -i http: |
grep -i htm |
sed s/^.*http/http/ |
cut -d'"' -f1 |
sort -u
); do
wget $LINK
donefor FILE in `ls`; do
FILE1=`echo $FILE | sed s/htm$/html/`
cat $FILE | grep -v -i SCRIPT > $FILE1
rm $FILE
done
)
doneprobably the coolest thing I ever wrote...
Cool!!!!!