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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make my cursor invisible? 1

Status
Not open for further replies.

squash

MIS
May 21, 2001
99
US
While attempting to "pretty up" a few of my scripts I have been trying to figure out how to temporarily turn off the cursor.
Or maybe better said , to set the cursor color to the same as the background so it is invisible.
Of course then set it back to normal when the script is finished.
Here is a quick example of a script.

#!/usr/bin/ksh

A=0
B=10

while [ A -ne $B ]
do
### Set cursor here
echo "$A\b\b\c"
sleep 1
let A=$A+1
done
### Return cursor to normal here

I have a lull of time at work lately, (very rare) so what better time to polish up my script writing abilities.

As always we thankyou for your support.
Doug
 
I don't know the exact sequence, but it's worth looking into 'tput'. vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
vlad,
Thankx for the thought, I also suspect this would be a key, however the man pages do not give anything but cursor postion.
I'll keep looking.
Thankx
Doug
 
From the manual pages for terminfo...
[tt]tput civis [/tt] -- Make cursor invisible
[tt]tput cnorm [/tt] -- Make cursor appear normal
 
EUREKA, and YAHOO !
terminfo is the man page I needed, thankx for you help Ygor.

Thx
Doug
 
you never read about stty, look at man stty
stty (+-) echo
does what you want.
 
Hey,
try this ..
#!/bin/bash
stty - echo #hide the cursor
do something
stty + echo #unhide it

You can also tput cup for positioning the cursor. Even on Linux, you can use echo with -e option for changing the color of cursor and also the background.

hope this helps :)
regards,
Mahesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top