The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Changing my Screen Resolution (Not in X) jjinno UNIX for Dummies Questions & Answers 3 07-18-2007 03:53 PM
screen display help zilla30066 Shell Programming and Scripting 2 01-30-2007 07:49 PM
Screen windows changing colours scpaterson UNIX for Dummies Questions & Answers 2 11-18-2005 04:20 AM
Changing Screen Resolution Aco SUN Solaris 1 07-18-2005 05:55 PM
controlling screen display jrdnoland1 Shell Programming and Scripting 6 02-08-2002 05:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-24-2008
raidzero's Avatar
raidzero raidzero is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 60
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 (permalink)  
Old 09-24-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,770
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 (permalink)  
Old 09-24-2008
raidzero's Avatar
raidzero raidzero is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 60
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 (permalink)  
Old 09-24-2008
raidzero's Avatar
raidzero raidzero is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 60
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 (permalink)  
Old 09-25-2008
raidzero's Avatar
raidzero raidzero is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 60
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
  #6 (permalink)  
Old 09-25-2008
raidzero's Avatar
raidzero raidzero is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 60
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 (permalink)  
Old 09-25-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,930
The WYSE60 requires a different set of escape sequences. Look in the termcap or terminfo database entries to find the correct escape sequences.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0