keystroke trap


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers keystroke trap
# 1  
Old 07-04-2005
keystroke trap

Hi,

How to track/trap the keyboard strokes in the script

say for eg, in normal scene, when a script is running, if a press control c, the program gets terminated...

so in this case, how do i trap the keystrokes so as to avoid the abort of the program..

pls help
# 2  
Old 07-04-2005
Control C and other similiar key combination result in signals which are passed to the script or applications. There is a shell command called trap.

Do a man trap and traverse to the trap description.

Also, similiar questions have been raised in this forum before. Use the search feature with the key words 'trap signal'.

vino
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Keystroke logging issue

I'm having an issue with keystoke logging. As we know in unix you can press tab to auto-complete a command or whatever it is you are typing. Well keystoke logging in /var/log/ks, tabs are actually showing up as tabs rather than whatever the auto-completion was. Any ideas? (5 Replies)
Discussion started by: scj2012
5 Replies

2. Homework & Coursework Questions

VM trap may work differently than a pure install trap.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: That is the last reply I received from my instructor, and I'm looking for some alternatives. When using... (2 Replies)
Discussion started by: newuser45
2 Replies

3. UNIX for Dummies Questions & Answers

Capturing the keystroke

i have the below script: #!/bin/bash echo "enter a" read a echo "enter b" read b let c=a+b echo $c at any point of time between entering the value for a and b,if user presses ctrl+a key combination, then it should start from the beginning(the script should be restarted). it should... (4 Replies)
Discussion started by: pandeesh
4 Replies

4. Shell Programming and Scripting

Regarding automatic keystroke

Hi All , I am writing a shell script for a 3D test case . The 3D Test case involves the user to press some keys to see the changes in the 3d test case . The user has to press p , r , a , z etc to observe the changes on screen . Now please let me know how can i implement the keystroke p , a ,... (1 Reply)
Discussion started by: dskonnur
1 Replies

5. Cybersecurity

Unix keystroke logger

Hi all, Does anyone know if there is a tool in the market that could do the following when System Admin log to the server as root and perform activities according to his change request: - trap or log his keystroke for the entire duration - provide a report on the changes SA has made to the... (3 Replies)
Discussion started by: mohzub
3 Replies

6. UNIX for Dummies Questions & Answers

ldapmodify: keystroke to apply changes

Hi, I need to modify some entries in LDAP, but with what keystroke do I exit and apply the changes? Thanks Brissix (0 Replies)
Discussion started by: brissix
0 Replies

7. Shell Programming and Scripting

Cntl+z Trap is not detecting ??? Help required to add a trap detection ???

Hi folks, I have tried to add some trap detection in the below script....this script is used to monitor database activities...in a rather awkward way :rolleyes:.... The idea behind adding trap is that....this script creates lots of temporary files in the running folder to store the count... (1 Reply)
Discussion started by: frozensmilz
1 Replies

8. Shell Programming and Scripting

Building a better mouse trap, or How many lines of code does it take to trap a mouse?

Hello all, I'm hoping to get a little insight from some of the wily veterans amongst you. I've written a script to check for new outgoing files to our vendors located on our ssl server. It seems to be working ok, but the final question here, will be one of logic, and/or a better way to... (4 Replies)
Discussion started by: mph
4 Replies

9. Linux

Keystroke log, eventlog, etc...

Don't you just hate crackers? Ok, I have a user on my server who is always causing trouble. He is constantly trying to get into files, change stuff, get users passwords, etc. I was wondering if Linux has a built in keystroke log, or event log of some sort that I may use to track his movements. ... (4 Replies)
Discussion started by: Phobos
4 Replies

10. Shell Programming and Scripting

csh exit while loop on keystroke

#!/bin/csh I'm using a `while(1)` loop to dispaly real-time information about various files on my system, and I use ^C to exit it when needed. I was hoping there was a way to exit the script on a normal keystroke such as "q". Can someone point me in the right direction? I'm willing to use a... (7 Replies)
Discussion started by: seg
7 Replies
Login or Register to Ask a Question