Computing.Net > Forums > Unix > Accepting user input mid page

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Accepting user input mid page

Reply to Message Icon

Name: Swapan Satpathi
Date: May 20, 2003 at 15:29:40 Pacific
OS: HP Unix
CPU/Ram: pentium/512Mb
Comment:

Hello,
I want to accept user input variable in the middle of the page or any specified location not at the starting of the line using read command.
If I use read command I have to enter the input a the beginning of the next line.

Any type of help is welcome. Thanks in advance.

Regards
Swapan



Sponsored Link
Ads by Google

Response Number 1
Name: Jimbo
Date: May 20, 2003 at 19:10:44 Pacific
Reply:

Just use newline metacharacters after the question you want answered:


#! /bin/sh
echo "Enter something:\n\n\n\n\n\n\n"
read ANSWER

....do stuff...

-jim


0

Response Number 2
Name: LANkrypt0
Date: May 21, 2003 at 06:50:13 Pacific
Reply:

I would recommend using tput

For example

#!/bin/ksh
echo "what is your name"
tput cup 10 10 ; read myname

This would ask, what is your name, then 10 lines down and 10 lines over you would be entering in your response. Its very flexible so you can basically have the user enter in their input anywhere. Play around with it.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


help with message Browsing on Unix



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Accepting user input mid page

How to hide user input in the shell? www.computing.net/answers/unix/how-to-hide-user-input-in-the-shell/798.html

Displaying calander www.computing.net/answers/unix/displaying-calander/6248.html

Taking input from file and user www.computing.net/answers/unix/taking-input-from-file-and-user/6752.html