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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get terminal width and cursor position Sreejesh.S High Level Programming 0 05-16-2008 04:02 AM
Command to know the terminal cursor position aneesha HP-UX 3 09-02-2007 03:16 PM
Cursor Global Position boogy High Level Programming 3 02-12-2007 08:18 AM
Cursor position gefa UNIX for Dummies Questions & Answers 3 03-17-2006 08:07 AM
Get the cursor position bestbuyernc Shell Programming and Scripting 0 07-27-2005 01:59 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-02-2008
Registered User
 

Join Date: May 2008
Posts: 10
Question Changing cursor position using shell script

Hi,

Pleae help me on this. Normally, when we say read username, the cursor will come in the first position of next line, but I want the output of the below


Normal usage
-------------

please enter username:
_ [cursor should blink in this position.]

I want like the below
----------------------

please enter username:

[space_space_space_space_] _ [cursor should blink in this position.]

I tried \t also, but not working
Reply With Quote
Forum Sponsor
  #2  
Old 06-02-2008
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 418
Please use tput commands for this:

tput cup row_num col_num
Reply With Quote
  #3  
Old 06-02-2008
mph mph is offline
Registered User
 

Join Date: Mar 2006
Posts: 44
Or you could try this if you don't know exactly what row your cursor may end up on while running the script.

printf "Please Enter User Name:\n\t\t\t"
read username

Or, for output on the same line.

printf "Please Enter User Name: "
read username
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0