2

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 ) &
maihabunash
  • 443
  • 1
  • 11
  • 25

4 Answers4

3

You need two backgrounded tailboxes and a static component. Msgbox will do.

dialog --begin 1 2 --tailboxbg a 10 70 --and-widget --begin 13 2 \
  --tailboxbg b 10 70 --and-widget --keep-window --msgbox "Exit" 5 10
Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
dsx724
  • 31
  • 2
2

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 
chriskelly
  • 576
  • 6
  • 11
2

Another way to follow multiple files is to use multitail.

multitail /var/log/proccess1.log /var/log/proccess2.log

Among its features:

  • filtering
  • highlighting
  • automatic and manual mark lines
Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
0

The latest version of the Unix tail command supports multiple -f as shown below.

tail -f /var/log/proccess1.log -f /var/log/proccess2.log
pratik
  • 11
  • 1