LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2009, 03:11 PM   #1
echobase
LQ Newbie
 
Registered: Aug 2009
Posts: 1

Rep: Reputation: 0
Controlling program execution...


Hi-

I need to be able to run a program from the command line and then have it terminate only when I type in a special code of my choosing. I would want to deactivate the usual CTRL-C method of termination. Is this possible?
 
Old 08-10-2009, 03:37 PM   #2
junust
Member
 
Registered: Jul 2008
Location: Israel Ramat Gan
Distribution: CentOs 5.3, SuSe 11.1, Solaris 9, Slackware 13
Posts: 81

Rep: Reputation: 15
I guess, if your keyboard will be on other then english lang set, CTRL+C won't work
 
Old 08-11-2009, 12:39 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Try the 'trap' cmd in bash
http://tldp.org/LDP/Bash-Beginners-G...ect_12_02.html
 
Old 08-11-2009, 02:08 AM   #4
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
to begin with, deactivating crtl-c should be as easy as this:
Code:
trap : SIGINT
Well I'm sure that works in shell script mode but not sure in direct interactive mode.
The other one will be a lot more difficult though. Perhaps in bash, you can do that by modifying readline settings. I never have done that before though. Do 'man bash'.

Last edited by konsolebox; 08-11-2009 at 02:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to know the program execution time daggulasreedhar Programming 6 03-15-2007 04:07 AM
HELP:Stopping execution of a program allomeen Programming 4 03-10-2006 06:42 PM
paralell program execution vishamr2000 Programming 17 08-28-2005 09:15 AM
execution of one program inside of another microsoft/linux Programming 2 03-18-2005 10:24 AM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration