- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Capturing Ctrl + C
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 01:48 AM
07-29-2005 01:48 AM
trap 'print "ENTER INFORMATION REQUESTED!"' INT
trap 'print "ENTER INFORMATION REQUESTED!"' QUIT
And then goes on to ask them for some requested information. For some reason it's not working correctly and ctrl + c breaks out of it. I've tried it with trap "" 1 2 3 and that isn't working either.
Any thoughts? Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 01:56 AM
07-29-2005 01:56 AM
Re: Capturing Ctrl + C
Use stty to change the intr value at the start and end of script . see stty -a
Why the trap.How is the script used
see
www.shelldorado.com for good shell tips
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 01:57 AM
07-29-2005 01:57 AM
Solutioneg
trap '' INT
will make it ignore Ctrl-C
trap 'echo test' INT
will make it print the word "test", then exit the program.
You can't have both unfortunately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 02:01 AM
07-29-2005 02:01 AM
Re: Capturing Ctrl + C
The command trap " INT generates syntax errors... should it not be trap "" INT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 02:10 AM
07-29-2005 02:10 AM
Re: Capturing Ctrl + C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 02:13 AM
07-29-2005 02:13 AM
Re: Capturing Ctrl + C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2005 11:38 AM
07-29-2005 11:38 AM
Re: Capturing Ctrl + C
And does it fail when you just use:
trap 'print blah' 2