2017-01-23 150 views

回答

0

解开你的ODS文件(这是一个zip压缩包),并运行下面的脚本(让调用它linkFinder):

#!/bin/bash 
urls=$(for f in `find -type f`; do grep xlink:href=\"[^\"]*\" -o $f | cut -c 13- | sed 's/.$//'; done); 

for url in $urls; 
do 
    wget -q --spider $url; 
    if [ $? -eq 0 ]; then 
    echo $url works 
    else 
    echo $url broken 
    fi 
done 

例子:

$ ./../linkFinder.sh 
http://google.pl/ works 
http://notexistingdomainforreal.com/ broken 
相关问题