Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting/splitting output to screen

Status
Not open for further replies.

tekinept

MIS
Oct 22, 2002
24
US
using ksh/bash, so should be able to work on both...
I have been unable to find anyway to specify exactly where on the screen to dump out put.
To explain would be to say, I am able to run 4 different scripts simultaneously, output of shell 1 would be top left, shell 2 bottom left, shell 3 top right, shell 4 bottom right.
Basically able to create something like top/topas (not realtime tho).

Now, I know I can do this many ways with assigning long variables, and echo in sequence, and the such. But I really would like to know if there is a built-in to do this, or a better way, so I can keep the formatting simple, without getting into perl-
 
I believe you gotta code it like this:

tput clear
tput cup 5 40; echo "this on line 5 in midscreen\c"
tput cup 12 1; echo "on line 12 on the left\c"
tput cup 1 40; echo "first line on the right\c"

play around with it a bit.



HTH,

p5wizard
 
Well, I think this does get some of it....
Also was thinking of resizing windows, trying
to use tput cols and lines to calculate where
actually to put things, but then realized I couldn't
wrap output, or truncate if I need to....
Hmm... I may be getting way over my head, and possibly
shells' head with that type of setup...
 
The curses library has a facility to create 'windows' on the text screen in which it will automatically scroll output, however I'm not sure how easily you could adapt that to your scripting requirements... maybe if you wrote a simple C programme that ran some shell scripts in each window after creating them? I'm guessing...

Annihilannic.
 
What OS is dscreen usually available on?

As far as I can tell from Google it sounds like the screen utility... i.e. you can switch between multiple full screen sessions, but you can't break the screen up in to separate 'windows'.

Annihilannic.
 
I keep forgetting not everyone uses god's own O/S (AIX) :(

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top