GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Control+C in ksh
Operating System - HP-UX
1848419
Members
2293
Online
104027
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
12-17-2003 08:43 PM
12-17-2003 08:43 PM
is it possible to disable Ctrl+C keystrokes from sending a INT signal in ksh?
I have a scripts that use to startup tomcat java process. The process attached itself to root 1 and completed it startup process but when i do Ctrl+C keystrokes to exit to prompt the tomcat java process dies.
tyl
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 08:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 08:50 PM
12-17-2003 08:50 PM
Re: Control+C in ksh
or reset the INT signal to some other key,
eg
stty intr ^Y
stty -a shows them all.
-- Graham
eg
stty intr ^Y
stty -a shows them all.
-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2003 10:57 PM
12-17-2003 10:57 PM
Re: Control+C in ksh
I would go for a combination of both... Using stty to set it to a unknown key combination (try to use something a user won't accidentally type, for instance some character above ascii code 128:
stty intr \222
Remember that stty doesn't set your interrupt only for the duration of your script, but also for when the script is finished. So when you finish the script, set it back to ^C, or better, build the script like this, with your real commands at the #Do your stuff:
trap 2 "echo Please do not interrupt this program"
OLDSETTINGS=$(stty -g)
stty intr \222
# Do your stuff
stty $OLDSETTINGS
stty intr \222
Remember that stty doesn't set your interrupt only for the duration of your script, but also for when the script is finished. So when you finish the script, set it back to ^C, or better, build the script like this, with your real commands at the #Do your stuff:
trap 2 "echo Please do not interrupt this program"
OLDSETTINGS=$(stty -g)
stty intr \222
# Do your stuff
stty $OLDSETTINGS
Every problem has at least one solution. Only some solutions are harder to find.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP