我得到了一堆 URL(超過 1,000 個),我想知道是否有 CLI 腳本來驗證 http 模式的 URL?
答案1
您可以使用 Perl 的Regexp::Common::URI::http
.來自CPAN 文檔:
use Regexp::Common qw /URI/;
while (<>) {
/$RE{URI}{HTTP}/ and print "Contains an HTTP URI.\n";
}
答案2
或者您想egrep "^https?:\/\/" yourlistofurls
檢查該 url 是否也指向有效的 http 內容?