我该如何对待一个命令的输出作为一个文件? [英] How can I treat the output of a command as a file?
问题描述
的鞭尾
命令有一个选项 - 具有下面的描述文本框
:
--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屋!