Stop cursor reading a value.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Stop cursor reading a value.
# 1  
Old 12-11-2003
Stop cursor reading a value.

Is it possible, in a Korn Shell script, to stop a cursor when I use the read command? More exactly, I try to have the cursor in a same line reading a value but not in a new line.
Maybe to display the value only if this value is right...

Do you have any idea about this? Is it possible?
Thanks in advance.

Giovanni
# 2  
Old 12-11-2003
in KSH use the /c in your echo statement.

example:

echo "Enter Some Text: \c "
read TEXT

This will cause the cursor to remain on the same line as the statement "Enter Some Text:"
# 3  
Old 12-12-2003
I tried also with print -n but in writing a on-line tool in korn shell, I wish, pressing enter, to avoid to have the cursor at a new line, waiting a new value if I insert, for example, a loop on read command.
I prefer not start a refresh on all previous values if sameting go wrong.
More exactly:

echo "Enter Text1: \c "
read TEXT (suppose the test is ok)

echo "Enter Text1: \c "
read TEXT (if the test fails, I want to restart from here)

In other words, I wish stop the cursor on second line while the test is ok.

Strange, but this is my problem. Using a while loop for the read command, do not work correctly.

Any idea will be well appreciated.
Thanks in advance.

Giovanni
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Passing the value of a cursor to another cursor

i have 2 cursors. i want to assign the value of first cursor(employee_id) to the where condition of cursor c2(please refer the bold statement). how do i do if i want to assign the value of c1 to where condition of cursor c2? declare cursor c1 IS select employee_id from employee cursor c2... (1 Reply)
Discussion started by: vkca
1 Replies

2. Shell Programming and Scripting

Getting the cursor position

I need to get the cursor position, and put it inside a variable. Problem is, i don't have the tput command, or ncurses. Apparently I was supposed to try the following: echo -e '\E But I don't get a value or anything. Please help. (3 Replies)
Discussion started by: tinman47
3 Replies

3. Shell Programming and Scripting

Using Cursor in Unix - How to do it (Need Help)

Hi, I have a table in which i have the following data JOB_NO FILE_ID FILE_NAME 1546148 1378788 PDF Sample -1.pdf 1546148 1378789 PDF Sample -2.pdf 1546149 1378790 PDF Sample -3.pdf Now I would like use a cursor like thing in unix to download the files using the file ids and send... (1 Reply)
Discussion started by: uuuunnnn
1 Replies

4. Shell Programming and Scripting

cursor positioning

Hi All, please help me to know how to move the cursor to the desired position? For example, in a shell script, I am displaying echo "\t Enter your Name:" please help me how to move cursor near the first word. for example, if the output is as below ... (3 Replies)
Discussion started by: little_wonder
3 Replies

5. UNIX for Dummies Questions & Answers

flashing cursor

I am running a psychology experiment with a UNIX shell script as a front end. This precedes each trial: echo -e "\n\n\n ***Ready***" sleep 1 clear Is there a way to get rid of the flashing cursor after the clear command has been executed or another command I could use instead? It is a... (0 Replies)
Discussion started by: darwin_886
0 Replies

6. Shell Programming and Scripting

scrolling cursor

Hi, I'm writing scripts in perl and shell and want to add the oprion of scrolling cursor on the screen when there is no output to the screen for long time. I saw it in some script but I don't have the source code. Are anyone know how can I perform this ? Thanks (1 Reply)
Discussion started by: Alalush
1 Replies

7. UNIX for Dummies Questions & Answers

Blinking cursor

Cursor is blinking (slightly) while loading page in Firefox, or during scrolling a window. I tried some variants of linux (gnome permanently) and of course my solaris. May be an artifact of X-window? Cause in windows cursor is stable (i'm feeling more confident). PS: It makes me nervous. (0 Replies)
Discussion started by: Xcislav
0 Replies

8. UNIX for Advanced & Expert Users

how to stop others users to stop viewing what i am doing ?

Hi , I have one question, suppose i am a normal user and when i use 'w' command , it shows who is logged on and what they are doing . Now i want to stop others users to know what i am doing accept the root ? can i do this ? thanks (5 Replies)
Discussion started by: mobile01
5 Replies

9. UNIX for Dummies Questions & Answers

Cursor Positioning

Can anyone tell me how to ouput the current cursor coordinate? I have tried using tput sc and tput rc. However I want to know what the coordinate is. Thanks. (1 Reply)
Discussion started by: bestbuyernc
1 Replies

10. Shell Programming and Scripting

Get the cursor position

Hello, Is there a way to get the current cursor position? I know "tput sc" saves it. Is there a way to find out the value saved? Thanks. (0 Replies)
Discussion started by: bestbuyernc
0 Replies
Login or Register to Ask a Question