使用Linux比较两个不同的URL
发布时间:2020-12-13 19:27:25 所属栏目:Linux 来源:网络整理
导读:我能够比较两个不同的网址/网站,而不首先使用wget或类似的东西下载文件.我尝试了以下,但收到以下错误. [root@desktop ~]# diff http://www.example.net/index.php http://www.example.com/index.phpdiff: http://www.example.net/index.php: No such file or
我能够比较两个不同的网址/网站,而不首先使用wget或类似的东西下载文件.我尝试了以下,但收到以下错误.
[root@desktop ~]# diff http://www.example.net/index.php http://www.example.com/index.php diff: http://www.example.net/index.php: No such file or directory diff: http://www.example.com/index.php: No such file or directory [root@desktop ~]# 解决方法
当然你可以使用curl,虽然它有点奇怪:
diff <(curl url1) <(curl url2) 在你的情况下: diff <(curl http://www.example.net/index.php) <(curl http://www.example.com/index.php) 请注意,您可以使用curl -s进行更清晰的差异执行. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |