从两个方案diff的输出,而不临时文件 [英] Diff output from two programs without temporary files

查看:148
本文介绍了从两个方案diff的输出,而不临时文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有太多的程序 A B ,我可以用运行./一个 ./ b

Say I have too programs a and b that I can run with ./a and ./b.

是否有可能无需先写入临时文件差异比较它们的输出?

Is it possible to diff their outputs without first writing to temporary files?

推荐答案

使用≤(命令)一个命令的输出传递到另一个程序,就好像它是一个文件名称。水管猛砸程序的输出到管道,并通过文件名如的/ dev / FD / 63 外命令。

Use <(command) to pass one command's output to another program as if it were a file name. Bash pipes the program's output to a pipe and passes a file name like /dev/fd/63 to the outer command.

diff <(./a) <(./b)

同样可以使用方式&gt;(命令)如果你想管的东西的的命令

Similarly you can use >(command) if you want to pipe something into a command.

这篇关于从两个方案diff的输出,而不临时文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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