我如何diff从网络的两个文件 [英] How do i diff two files from the web

查看:179
本文介绍了我如何diff从网络的两个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看不在本地文件系统但在网络上的2个文件的差异。所以,我想如果必须使用 diff curl 和某种管道。

I want to see the differences of 2 files that not in the local filesystem but on the web. So, i think if have to use diff, curl and some kind of piping.

curl http://to.my/file/one.js http://to.my/file.two.js | diff 

但不起作用。

推荐答案

UNIX工具 diff 可以比较两个文件。如果使用<()表达式,您可以在命令中比较命令的输出:

The UNIX tool diff can compare two files. If you use the <() expression, you can compare the output of the command within the indirections:

diff <(curl file1) <(curl file2)

所以在你的情况下,你可以说:

So in your case, you can say:

diff <(curl http://to.my/file/one.js) <(curl http://to.my/file.two.js)

这篇关于我如何diff从网络的两个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆