How to find entering ENTER key?.


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find entering ENTER key?.
# 1  
How to find entering ENTER key?.

Hello All,

i have a script to get input from the user like bellow,

read -p "Do you want to continue (y/n) : " status

i want to identify the pressing of Enter Key with out giving any value for the above statement and i want get the status if we press Enter key during run time.

How to do this?.

Thanks in advance.

Cheers!
Saravana Smilie
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #208
Difficulty: Medium
Open Shortest Path First (OSPF) was designed as an exterior gateway protocol (EGP) for use in an autonomous systems such as a local area network (LAN).
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Simulate enter key

I have a popup window that appears on every boot up. I would like to have it dismissed automatically each time instead of having to hit the enter key. I thought I could write a script that would execute on startup. I tried this xdotool key return andy@7_~/Downloads$ xdotool key ... (7 Replies)
Discussion started by: drew77
7 Replies

2. UNIX for Dummies Questions & Answers

Auto ENTER key on TERM

I'm working in a UNIX box that's owned by a vendor. They have it set up by State, meaning when I need to program script related to certain States, I type in, for example, "CA", it goes to a whole other terminal: ddqsw:pts/2:login miller CA TERM = ( vt100 ) When I do this I have to hit... (7 Replies)
Discussion started by: shorty
7 Replies

3. Shell Programming and Scripting

Disable Enter key to be pressed

Hi Experts, I have a script in which I want to disable the "Enter" key press. Actually my script executes some process in background. So, till that background process is running, I don't want "Enter" key to be pressed by user. Is this can be achieved using trap command? (6 Replies)
Discussion started by: R0H0N
6 Replies

4. Shell Programming and Scripting

How to issue ctrl+D and enter key

My problem is that i have to connect Linux server. I can connect it with SSH but because of the software of the Linux server, i need to press enter and after ctrl+D. Therefore, I need to write a script that should press enter and ctrl+D. How can i write it in KSH shell script. HELP ME! (7 Replies)
Discussion started by: fozay
7 Replies

5. Shell Programming and Scripting

enter key solaris

Hi, When I run script on Sun Solaris (sassetup), it prompts to "Press Enter To Continue". Now I want to automate this, ie put sassetup in a script file. So, when I run this file, it should be executed automatically without waiting for anyone to press Enter Key. I have tried the following... (1 Reply)
Discussion started by: sajjunaqvi
1 Replies

6. Shell Programming and Scripting

trap signal for enter key

hi , What is the trap signal for "ENTER key"? (4 Replies)
Discussion started by: Sreejith_VK
4 Replies

7. UNIX for Advanced & Expert Users

using enter key in shell script

without pressing the enter key ..manually... how can we read the enter key ..from the shell script..so that the script termintes automatically. eg: telnet a.b.c.d xxxx now " how to read the enter key" tho terminate the script (1 Reply)
Discussion started by: bishweshwar
1 Replies

8. UNIX for Dummies Questions & Answers

Pressing backspace key simulates enter key

Hi, Whenever i press the backspace key, a new line appears, i.e. it works like a enter key. :confused: Thanks (2 Replies)
Discussion started by: vibhor_agarwali
2 Replies

9. Shell Programming and Scripting

read the ENTER key

Hi , I do the following : ]echo "Do you want to say yes or no ?(y/n):\c" read ans here 'n' is the default value.that means if the user press ENTER key then it should be 'n' . Now how do i know that the user has pressed ENTER key.What will be stored in my variable 'ans'. (4 Replies)
Discussion started by: sars
4 Replies
Key :: Methods for Making Tests(3)			     Library Functions Manual				Key :: Methods for Making Tests(3)

NAME
Key :: Methods for Making Tests - Methods to do various tests on Keys. Functions int keyNeedStat (const Key *key) int keyNeedSync (const Key *key) int keyNeedRemove (const Key *key) int keyIsSystem (const Key *key) int keyIsUser (const Key *key) int keyIsBelow (const Key *key, const Key *check) int keyIsDirectBelow (const Key *key, const Key *check) int keyIsInactive (const Key *key) int keyIsDir (const Key *key) int keyIsBinary (const Key *key) int keyIsString (const Key *key) Detailed Description Methods to do various tests on Keys. To use them: #include <kdb.h> Function Documentation int keyIsBelow (const Key *key, const Key *check) Check if the key check is below the key key or not. Example: key user/sw/app check user/sw/app/key returns true because check is below key Example: key user/sw/app check user/sw/app/folder/key returns also true because check is indirect below key Parameters: key the key object to work with check the key to find the relative position of Returns: 1 if check is below key 0 if it is not below or if it is the same key See also: keySetName(), keyGetName(), keyIsDirectBelow() int keyIsBinary (const Key *key) Check if a key is binary type. The function checks if the keytype is in the range between KEY_TYPE_BINARY and less than excluding KEY_TYPE_STRING. Then it will be interpreted as binary. Make sure to use this function and don't test the binary type another way to ensure compatibility and to write less error prone programs. Returns: 1 if it is binary 0 if it is not -1 on NULL pointer See also: keySetType() for more information on types keyGetBinary(), keySetBinary() Parameters: key the key to check int keyIsDir (const Key *key) Check if a key is directory key. Folder keys may also have value and comment. They are discern by having a executable bit set. If any executable bit is set it will be recognized as a directory. Note: keyIsDir may return true even though you can't access the directory. To know if you can access the directory, you need to check, if your o user ID is equal the key's user ID and the mode & 100 is true o group ID is equal the key's group ID and the mode & 010 is true o mode & 001 is true Accessing does not mean that you can get any value or comments below, see Mode for more information. Parameters: key the key object to work with Returns: 1 if key is a directory, 0 otherwise -1 on NULL pointer See also: keySetDir(), keySetMode() int keyIsDirectBelow (const Key *key, const Key *check) Check if the key check is direct below the key key or not. Example: key user/sw/app check user/sw/app/key returns true because check is below key Example: key user/sw/app check user/sw/app/folder/key does not return true, because there is only a indirect relation Parameters: key the key object to work with check the key to find the relative position of Returns: 1 if check is below key 0 if it is not below or if it is the same key -1 on null pointer See also: keyIsBelow(), keySetName(), keyGetName() int keyIsInactive (const Key *key) Check whether a key is inactive or not. In elektra terminology any key is inactive if the it's basename starts with '.'. Inactive keys must not have any meaning to applications, they are reserved for users and administrators. To remove a whole hierarchy in elektra, don't forget to pass option_t::KDB_O_INACTIVE to kdbGet() to receive the inactive keys in order to remove them. Otherwise you should not fetch these keys. Parameters: key the key object to work with Returns: 1 if the key is inactive, 0 otherwise -1 on NULL pointer or when key has no name int keyIsString (const Key *key) Check if a key is string type. The function checks if the keytype is larger or equal KEY_TYPE_STRING. Then it will be considered as string type. Make sure to use this function and don't test the string type another way to ensure compatibility and to write less error prone programs. Returns: 1 if it is string 0 if it is not -1 on NULL pointer See also: keySetType for more information on types keyGetString(), keySetString() Parameters: key the key to check int keyIsSystem (const Key *key) Check whether a key is under the system namespace or not Parameters: key the key object to work with Returns: 1 if key name begins with system, 0 otherwise -1 on NULL pointer See also: keyIsUser(), keySetName(), keyName() int keyIsUser (const Key *key) Check whether a key is under the user namespace or not. Parameters: key the key object to work with Returns: 1 if key name begins with user, 0 otherwise -1 on NULL pointer See also: keyIsSystem(), keySetName(), keyName() int keyNeedRemove (const Key *key) Ask if key is marked for permanent remove. Ask if the key will be removed instead of writing in the key database when doing kdbSetKey() or kdbSet(). See also: keyRemove() kdbSet(), kdbSetKey(), kdbRemove() Parameters: key the key object to work with Returns: 1 if it is marked, 0 otherwise -1 on NULL pointer int keyNeedStat (const Key *key) Ask if key is marked for stat only. Ask if the key will be stat instead of get it from the key database completely doing kdbGetKey() or kdbGet(). This is useful if you are not interested in the value, comment or key type. See also: keyStat(), kdbGet() Parameters: key the key object to work with Returns: 1 if it is marked, 0 otherwise -1 on NULL pointer int keyNeedSync (const Key *key) Test if a key needs to be synced to backend storage. If any key modification took place the key will be flagged with KEY_FLAG_SYNC so that kdbSet() knows which keys were modified and which not. After keyNew() the flag will normally be set, but after kdbGet() and kdbSet() the flag will be removed. When you modify the key the flag will be set again. In your application you can make use of that flag to know if you changed something in a key after a kdbGet() or kdbSet(). Note: Note that also changes in the meta data will set that flag. See also: keyNew() Parameters: key the key object to work with Returns: 1 if key was changed in memory, 0 otherwise -1 on NULL pointer Author Generated automatically by Doxygen for Elektra Projekt from the source code. Elektra Projekt Fri Aug 26 2011 Key :: Methods for Making Tests(3)

Featured Tech Videos