![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| To print a specific line in Shell or awk. | tushar_tus | Shell Programming and Scripting | 4 | 10-23-2008 01:12 PM |
| Error while trying to print message | Navatha | Shell Programming and Scripting | 3 | 10-08-2008 12:54 PM |
| How to print specific lines with awk | Bugenhagen | Shell Programming and Scripting | 10 | 08-16-2007 07:41 AM |
| How to print a specific page | randomcz | UNIX for Dummies Questions & Answers | 3 | 01-31-2007 03:03 PM |
| shell specific prompt | dranNfly | UNIX for Dummies Questions & Answers | 3 | 04-27-2005 09:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Print a message at specific line on prompt
Hi Friends,
I am using HP-UNIX(ksh). I want to print a message at specific line on the prompt screen. For Example: for num in 1 10 3 145 do echo $num // need to print this on the same line for each number sleep 2 done Actual Output: ========== 1 10 3 145 Expected Output: ============= 1 then it will be 10 then 3 and at last 145 (like a electronics stopwatch display) please suggest me how to do this? can we use tput here? |
|
||||
|
Actual problem is how to get the variable cursur point !
Thanks Franklin..
But the actual problem here is to get the cursor position dynamically. The cursor pos is variable and this prog need to get the printing position before printing to that location. Other parts like clearing we can use our own logic. Like .. ==================== for e in asd niroj sinu rajesh ava o do l=` expr length $e ` tput cup 30 40#This is varible. I need to get the cursor pos dynamically while [ $l -ge 0 ] //to clear at position i am overwriting with space double the prev word length do print " \c" l=` expr $l - 1 ` done tput cup 30 40#This is varible. I need to get the cursor pos dynamically echo $e sleep 1 done |
|
||||
|
Got the solution to get the cursor pos dynamically
Actually this solution I got from a site..
for num in 1 10 3 145 do tput sc //Save the current cursor position echo "$num\c" tput rc //Recover the saved cursor position sleep 1 tput el //Clears the current line tput rc done ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|