Linux – how to run the dialog command with proccess

bashdialoglinuxprocessshell-scripting

Please look on my code – ( bash script )

I want to display both dialogs on the screen on the same time,

one dialog display the:

tail –f from – /var/log/proccess1.log ,

and the second dialog display the:

tail –f from the file – /var/log/proccess2.log

but the sad fact is that I can display only one dialog and not both dialogs ( because when I run the first dialog , the second dialog will activate only if the first dialog will killed )

So I create process on the second dialog ( ….. ) & , in order to display both dialogs

But …. the second dialog create process number but not create the second dialog GUI , ( seems that when we create dialog with process , the process not send the dialog to standard output )

So how to run the second dialog with process but send the dialog GUI to screen ? , or other solution in order to display both dialogs on screen

My code

     #!/bin/bash

     # this dialog will locate the tail box on the top of the screen
     dialog --begin 15 10  --tailbox   /var/log/proccess1.log  13 125 


     # this dialog will locate the tail box down in the screen
     ( dialog --begin 37 10  --tailbox   /var/log/proccess2.log    13 125 ) &

Best Answer

You can display multiple dialogs with --and-widget.

Try something like:

dialog --begin 1 1 --tailboxbg FILE1 10 100 --and-widget --begin 20 1 --tailbox FILE2 10 100