我该如何对待一个命令的输出作为一个文件? [英] How can I treat the output of a command as a file?

查看:125
本文介绍了我该如何对待一个命令的输出作为一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鞭尾命令有一个选项 - 具有下面的描述文本框

--textbox <file> <height> <width>

第一个选项需要一个文件作为输入;我想用一个命令的输出在它的地方。看起来这应该是可能在bash - 可能与重定向?对于这个问题的缘故,让我们说,我想在鞭尾文本框来查看的ls -l <​​/ code>的输出。

The first option requires a file as input; I would like to use the output of a command in its place. It seems like this should be possible in bash - possibly with redirection? For the sake of the question, let's say I'd like to view the output of ls -l in a whiptail textbox.

它看起来像标记的回答也回答我问的问题,只是没有问候鞭尾。例如,猫≤(ls -l命令)的作品。因此,我将迎来了一个问题,回答,即使鞭尾的具体例子不与进程替换工作。

It looks like the marked answer does answer the question I asked, just not as regards to whiptail. For example, cat <(ls -l) works. Hence I will mark the question as answered, even though the specific example of whiptail does not work with process substitution.

推荐答案

您可以使用此进程替换语法:

--textbox <(command) 600 800

替换命令您的自定义命令。

这篇关于我该如何对待一个命令的输出作为一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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