- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: disable control c on shell user program.
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
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
03-03-2003 07:36 AM
03-03-2003 07:36 AM
I have a user which shell is sh.
On his .profile there is a line calling to an shell script which is a menu, once the user is running that script, I don??t want he can make control-c to stop the script and go out to sh shell.
What is the way to do this ?.
Thanks.
Juanma.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 07:53 AM
03-03-2003 07:53 AM
Re: disable control c on shell user program.
Add this to your shell:
trap '' int
...or if you wish to offer a message with receipt of the CNTL_C:
trap 'echo control_C has been disabled' INT
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 10:38 AM
03-03-2003 10:38 AM
Re: disable control c on shell user program.
#start of .profile
.
.
.
.
#call the menu
/usr/bin/your_menu
exit
End of .profile
When your_menu is terminated, either on purpose or by any key stroke, the next command in .profile is an exit and it forces the user back to a logon screen.
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2003 11:45 AM
03-03-2003 11:45 AM
Re: disable control c on shell user program.
Other possible way is the following:
#Start of menu script
stty intr ''
.
.
.
.
stty intr '^C' #Restore Ctrl-C feature
#End of menu script
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 12:40 AM
03-04-2003 12:40 AM
Re: disable control c on shell user program.
Special Thanks to Clay, Your plan B works fine.
Thanks again.
Juanma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2003 04:50 AM
03-04-2003 04:50 AM
Re: disable control c on shell user program.
You may find a better way is to run the menu as the users shell. Ensure that you reference the .profile and /etc/profile from within the menu (shell) and include the menu (shell) in /etc/shells if this file exists on your system.
When the login menu (shell) exits, there is nowhere else for the user to go.