3

The whiptail command has an option --textbox that has the following description:

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

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.

Update

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.

JoBu1324
  • 7,751
  • 6
  • 44
  • 61
  • I've created [another stackoverflow question](http://stackoverflow.com/q/23089988/118234) to specifically address whiptail, if anyone is interested. – JoBu1324 Apr 15 '14 at 17:00

2 Answers2

6

You can use this process substitution syntax:

--textbox <(command) 600 800

Replace command with your custom command.

anubhava
  • 761,203
  • 64
  • 569
  • 643
-1

Does this meet your needs? ls -l > my_file whiptail --textbox my_file

Freerobots
  • 772
  • 1
  • 6
  • 20