2

I want to view on the Linux console two dialog windows on the same time.

I want a window that views the progress BAR, and the a second tailbox that view the logs are running.

The problem is that the dialog appears always in the center of the console.

What I want is

  1. to view the two dialog boxes on the same time on the console,
  2. while the progress bar is on the top of the screen,
  3. and the the box should present down in the screen.

How to implement this?

How to place the dialog window up or down and not in the central?

    dialog --title "RUN TASKS FROM TEXT TABLE" --gauge "Please wait..." 10 70 0
    dialog --tailbox file.log 10 100
Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
maihabunash
  • 443
  • 1
  • 11
  • 25

1 Answers1

3

You can use screen program.

enter image description here

Executing screen manually

After installing screen, execute it by typing screen in your console.

Split your screen by pressing ctrla then S (uppercase S, with shift

Enter your first command

After having the fist command executed, press ctrla then tab to switch to the another window.

Press ctrla then c

Enter the second command.

Done.


Using a script

Create a new directory where you would want to put the script, ie. ~/test/

Create a .screenrc file with the following content:

startup_message off
screen dialog --title "RUN TASKS FROM TEXT TABLE" --gauge "Please wait..." 10 70 0
split
focus down
screen dialog --tailbox /var/log/syslog 10 100

Then just enter screen command to execute the script.

kazy
  • 271
  • 1
  • 8
  • the problem is that I not want to edit it manual , is shuld be run by bash script , can you please advice how to use the screen command in bash script to do the same as you explain here but from script ? – maihabunash Sep 18 '14 at 14:38
  • I have modified the answer, take a look please – kazy Sep 18 '14 at 14:49
  • startup_message off isnt valid in linux the same about focus down – maihabunash Sep 18 '14 at 14:51
  • It is valid, you can take a look here: http://linux.die.net/man/1/screen The script I have show you works on my Debian box (screenshot attached in the answer). – kazy Sep 18 '14 at 14:58
  • HOW IT IS VALID: ( run this on linux and tell me what you see - startup_message off ) – maihabunash Sep 18 '14 at 15:00
  • any way its not valid on my linux ( the same on all linux versions ) – maihabunash Sep 18 '14 at 15:00
  • From what I see, you are trying to execute `.screenrc` file directly. It is NOT a sh/bash script file, it is a script file for `screen` program. All you need to do is to create `.screenrc` file with the contents I have posted, and then execute `screen` command in the same directory. – kazy Sep 18 '14 at 15:02
  • you say here that I need to enrer the screen comand , is it possible to run the screen also from script ? – maihabunash Sep 18 '14 at 15:11
  • Yes, you can create a `script.sh` file with following content: `chdir /your/directory && /usr/bin/screen`. – kazy Sep 18 '14 at 15:25
  • I run this screen .screenrc ( but without results ) – maihabunash Sep 18 '14 at 15:26
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/17264/discussion-between-maihabunash-and-adam). – maihabunash Sep 18 '14 at 15:29
  • I not understand how you run the two windows , I run the screen command alone and screen .screenrc , both are not works! – maihabunash Sep 18 '14 at 15:33
  • You need to execute `screen` command inside directory where `.screenrc` file is located – kazy Sep 18 '14 at 15:35
  • YES I did it and its not works! – maihabunash Sep 18 '14 at 15:39
  • any other ideas? – maihabunash Sep 18 '14 at 15:46