![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ERROR: more than one instance of overloaded function "vprintf" has "C" linkage | donatoll | HP-UX | 0 | 10-14-2008 06:35 AM |
| Strange error "host: isc_taskmgr_create: no available threads" | Santi | Linux | 0 | 01-03-2008 05:49 AM |
| "syntax error at line 21 :'done' unexpected." error message" | ibroxy | Shell Programming and Scripting | 3 | 08-08-2007 07:45 AM |
| Help! "Bus error" and "CPU Panic" box wont boot | hcclnoodles | SUN Solaris | 3 | 10-05-2006 05:38 PM |
| how to request a "read" or "delivered" receipt for mails | plelie2 | Shell Programming and Scripting | 1 | 08-06-2002 04:26 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Good day.
I really hope U can help me with this as I'm stumped! In the command line eg: read X; echo $x . Works perfectly fine. Then running the same thing in my script it sometimes exiqute immediatly after pressing enter and continuiing. Not exiting the script I re-run the "read" section. Then after enterting some text. The curour jumps to the next line. I have to press enter 3-4 times before the script is running. It's like there are 3/4 read's in a row, but the script only has one. I've put echo's everywhere to find the problem, but the ONE read command creates random "read" instances. I can also just type 3-4 caracters and then the script continus to run. VERY STRANGE! Please help. Here is the script so far. #!/usr/bin/bash key="Y" #Display the email file with line number in it function DISPLAYFILE { nl EMAILADDYS } function REMOVE { clear; echo "Good day..." echo nl EMAILADDYS echo echo "Please select the number related to the email U would like to remove:" read dn; echo $dn; echo $dn read; #key="Y"; } function ADDMAIL { clear; echo "ENTER STUFF:" read newmail; echo $newmail >> EMAILADDYS; #key="Y"; } DISPLAYFILE; while [ $key != "X" ]; do clear; echo "GOOD DAY" echo Below is the Email Addreses listed to recive the backup report DISPLAYFILE; echo "Please choose (A)dd or (R)emove or (E)exit." printf ">" read -n1 key #echo $key case $key in a) ADDMAIL;; A) ADDMAIL;; R) REMOVE;; r) REMOVE;; e) echo "EXITING"; key="X";; E) echo "EXITING"; key="X";; *) echo "WRONG KEY PRESSED"; sleep 1;; esac done; |
| Bookmarks |
| Tags |
| read command vi unix user |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|