|
|
申明一点:
以下代码我是在win32环境下用的,linux下还没有测试过。
代码用到的wget,cat等来自gnuwin32项目。
以下是主脚本:
- wget http://www.linuxfromscratch.org/hlfs/view/unstable/uclibc/chapter04/patches.html
- wget http://www.linuxfromscratch.org/hlfs/view/unstable/uclibc/chapter04/packages.html
- cat patches.html packages.html > uclibc.htm
- perl fio3.pl
- wget -N -i uclibc_down_list.txt
- rm -v patches.html packages.html uclibc.htm
复制代码
下面是fio3.pl有代码:
- open FILE, "uclibc.htm" or die "the file not exists";
- open FILE2, ">uclibc_down_list.txt" or die "the output file not exists!";
- while(<FILE>){
- if(/ftp|http/){
- @new_line = split(/"/, $_);
- if($new_line[1] =~ /^ftp|^http/ && $new_line[1] =~ /gz$|bz2$|patch$/){
- print FILE2 $new_line[1]."\n";
- }
- }
- }
- close FILE;
- close FILE2;
复制代码 |
|