A entry form


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting A entry form
# 1  
Old 09-21-2004
Question A entry form

Want to make a entry for using shell script, something like this:

Name:_____________ Age:____________
address:___________

This entry form showed on the screen when the script executed, ask the user enter the field one by one ( user press <Enter>, cursor will be on the next field), anyone got idea about this?
is it possible?

or what command should be used for control the cursor?

Thanks
# 2  
Old 09-21-2004
You can use the echo command with Escape sequences to control the cursor - you would need to insure everyone using the script was using VT100 terminal emulation.

To put in an escape sequence in vi, go to insert mode, use the Control and v keys together, then Control and [ together to create an escape sequence - then [, line number and column.

Example:

^[[19;1H would be setting the cursor on line 19, column 1. You would also need to use the echo -n when requesting feedback (asking a question)

echo -n "^[[19;1H Enter your name: "
# 3  
Old 09-21-2004
You can manage the cursor using the tput command. See the man page for this command.
# 4  
Old 09-21-2004
Thanks Google - never knew that one!
# 5  
Old 09-22-2004
Your Welcome! I recently found this command as well when I had to write a menu interface in shell. I didnt want to keep echo'ing back to the screen and have my menu scroll off the screen. Now, I use tput with sc (to save the cursor position), rc (to restore the cursor position) and ed (to clear the screen below the cursor position). tput won't win any speed races, its slow to initialize but a couple of seconds didnt bother me Smilie

Here is a link I found with examples and a list of options/capabilities. Click Here
# 6  
Old 09-22-2004
Just wanna say :

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies

2. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

3. Shell Programming and Scripting

Can't submit a form.

hello my script is submitting POST-data to a site (its not my first script, i've done these before many times (include parsing scripts) but this one is tough) so the problem is i'm submitting a form with firefox and in firebug i see WHAT exactly i'm submitting then when i do EXACTLY the... (28 Replies)
Discussion started by: tip78
28 Replies

4. Shell Programming and Scripting

Remove x lines form top and y lines form bottom using AWK?

How to remove x lines form top and y lines form bottom. This works, but like awk only cat file | head -n-y | awk 'NR>(x-1)' so remove last 3 lines and 5 firstcat file | head -n-3 | awk 'NR>4' (5 Replies)
Discussion started by: Jotne
5 Replies

5. Shell Programming and Scripting

Transpose Data form Different form

HI Guys, I have data in File A.txt RL03 RL03_A_1 RL03_B_1 RL03_C_1 RL03 -119.8 -119.5 -119.5 RL07 RL07_A_1 RL07_B_1 RL07_C_1 RL07 -119.3 -119.5 -119.5 RL15 RL15_A_1 RL15_C_1 RL15 -120.5 -119.4 RL16... (2 Replies)
Discussion started by: asavaliya
2 Replies

6. Web Development

Email Form

Hi everyone, I am glad to be part of this forum. My question is about setting up email on my website. I need to know how would I proceed in order to create a form so my visitors can register directly for email without me assigning them a password. In order words I need them to be able to... (2 Replies)
Discussion started by: jpotea9780
2 Replies

7. Cybersecurity

I need help with contact form

How can I change my email address from text into an image? Someone told me that this way it won't be picked up by spam bots and it will reduce spam. ---------- Post updated 09-27-09 at 12:57 AM ---------- Previous update was 09-26-09 at 10:53 AM ---------- ---------- Post updated at 12:58 AM... (0 Replies)
Discussion started by: iorgusu
0 Replies

8. UNIX for Dummies Questions & Answers

Form Feed...

Hi, I've a text file that has a formfeed character at the beginning. I want to get rid of this formfeed character using sed. But I don't know how to specify the formfeed character. I've tried \014 (octal for formfeed), \f but still not works. Regards, Johnny (5 Replies)
Discussion started by: johnny_woo
5 Replies

9. UNIX for Advanced & Expert Users

Changing Unix form to Microsoft Word form to be able to email it to someone.

Please someone I need information on how to change a Unix form/document into a microsoft word document in order to be emailed to another company. Please help ASAP. Thankyou :confused: (8 Replies)
Discussion started by: Cheraunm
8 Replies
Login or Register to Ask a Question