display changing variable in one place on screen in ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting display changing variable in one place on screen in ksh
# 1  
Old 09-24-2008
display changing variable in one place on screen in ksh

Is it possible using just korn shell script to display a variable on the screen that is constantly changing in on place on the screen, to tell it in coordinates or something? In a loop, echo will print a new line each time, can I make it a static position? Thanks
# 2  
Old 09-24-2008
In a console, yes. Use ANSI escape sequences to move the cursor. The terminal has to emaulate vt102 or a similar terminal type.

ASCII Table - ANSI Escape sequences

Edit: use the printf statement to create escape sequences.
# 3  
Old 09-24-2008
The terminal emulation is ANSI for telnet sessions (which is what I use), and IBM3151 for real terminal sessions. I am assuming since they are called ANSI escape sequences that it should work for a telnet session? I looked at man printf and did not find any mention of ascii in it. Sorry for being such a noob, but could you give an example command?
# 4  
Old 09-24-2008
I have managed to figure out changing colors with ansi escape sequences:

printf "\033[32m`date`\033[0m\n"

will print the date and time in green. now I know that my emulation supports this, just now need to know how to position the text. Thanks
# 5  
Old 09-25-2008
I found this

Bash Prompt HOWTO: ANSI Escape Sequences: Colours and Cursor Movement

to be quite useful. Thanks for the tip on ANSI escape sequences Smilie
# 6  
Old 09-25-2008
Don't suppose you can somehow do this in WYSE60 emulation? I just tried it and it just printed the escape sequences on the screen...
# 7  
Old 09-25-2008
The WYSE60 requires a different set of escape sequences. Look in the termcap or terminfo database entries to find the correct escape sequences.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Changing dpi screen resolution in Solaris 10.

Hi, everyone! I would like to try OpenStep for Solaris on my Sun Ultra 10 machine, so I installed all required packages, the problem is that OpenStep requires screen DPI to be set to 72x72 while my current dpi is 90x90. So how do I change the dpi? Thank you! (0 Replies)
Discussion started by: nongrato
0 Replies

2. Shell Programming and Scripting

Print one's place for 1 to N times, ksh Perl whatever?

Hello all, I would like to create a for loop or whatever is quick that will print the one’s place of a number for 1-N times say for example a printed page formatting is 132 characters wide, I would like a single line 123456789012345678901234567890... ...012 That is 132 characters long. I... (11 Replies)
Discussion started by: KmJohnson
11 Replies

3. UNIX for Advanced & Expert Users

How to display the files on screen

I connect via vnc to a linux computer. after a logout, I cannot see the files on the screen (although i can see the screensaver). I can open a terminal and see the files etc. How can i see the files on the screen again? (5 Replies)
Discussion started by: FelipeAd
5 Replies

4. UNIX for Dummies Questions & Answers

Changing the screen resolution

I have installed several flavors of Linux and FreeBSD onto my machine. Now when I want to change my screen resolution, it only has one option which is 800x600. Is there a way to change that to a bigger resolution? And if there is, what file do I have to edit and what text editor do I have to use?... (2 Replies)
Discussion started by: figaro
2 Replies

5. Shell Programming and Scripting

ksh - truncate a log in place, sed -i not available captain!

Hi there:) Because of security requirements, It would be much better if I could truncate my logs in place using sed -i (or ?). I cant use the -i option on sed in my environment. Can anyone help a DBA? (5 Replies)
Discussion started by: quigley007
5 Replies

6. AIX

CDE running but not display on screen

Runing p550Q via HMC I'd like to start using graphic interface CDE: lslpp -l | grep X11.Dt* X11.Dt.ToolTalk -- AIX CDE ToolTalk Support X11.Dt.bitmaps -- AIX CDE Bitmaps X11.Dt.helpmin -- AIX CDE Minimum Help Files X11.Dt.helprun -- AIX CDE Runtime Help X11.Dt.lib -- AIX CDE... (0 Replies)
Discussion started by: silves
0 Replies

7. UNIX for Dummies Questions & Answers

Changing my Screen Resolution (Not in X)

I have no graphical environment, no X, just a shell... but its WAY bigger than my monitor... what do I do? (3 Replies)
Discussion started by: jjinno
3 Replies

8. Shell Programming and Scripting

screen display help

Hello All, I have a file that is formatted like this 1234556 1234567 1234588 1123888 1999999 1010101 1919191 1919191.... for a total of 26000 + lines how do I get a script to read lets say 50 lines at a time and display the output to the screen in column format around 5 or 6... (2 Replies)
Discussion started by: zilla30066
2 Replies

9. Solaris

Changing Screen Resolution

I have installed Solaris 10 over vmware onto my machine. Now when I want to change my screen resolution it only has one option which is 800x600. Is there a way to change that to a bigger resollution? And if there is, what file do I have to edit and what text editor do I have to use? (1 Reply)
Discussion started by: Aco
1 Replies

10. Shell Programming and Scripting

controlling screen display

How can I control the screen output when trying to read a large file onto the screen x number of lines at a time. I'm trying to use this is a bourne shell script. I want to display 10 lines of a file, pause the screen so that a user can read the file, and then display the next 10 lines of the file,... (6 Replies)
Discussion started by: jrdnoland1
6 Replies
Login or Register to Ask a Question