读取 .ods 文件并在浏览器中打开 link

Read .ods file and open the link in the browser

我有一个 .ods 文件,其中有 150 个 links.I 需要检查所有链接是否正常,或者 not.How 我可以使用 code.I 不想做的事情吗手动。

解压缩您的 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