How can I reroute a program's output to a dialog
window instead of stdout
or stderr
using bash?
I don't want to capture that output to a variable by using variable=$(appname)
and display it afterwards by using dialog --msgbox
. I want to have something like a runtime rerouting so that the program's output is displayed in that dialog
window as it is generated. Not after it's finished.
Is that possible?
Thank you!
The
--progressbox
option is what you are seeking. See this example:It will display the data as it is printed to
stdout
. In your case, you can pipe your application's output to thedialog
command like this:If you want to display an
OK
button, when the output fromappname
finishes, you can use the--programbox
option instead.See man page for details.