Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I do not think that does not work. Just you need to know what will/should happen:
First, it is not Ctrl-C, but an event. The name of that event is sigint (that means sending a signal named interrupt).
To check which key will initiate this event you need to execute:
And you will see it is attached to ^C (^ means Ctrl-). Also you will see another events, like sigquit, sigstop...).
Next come two questions: what will send this signal and what will catch it. Usually the terminal handler will send it and the process using that terminal will catch it (but it is configurable). There are processes which has no terminal attached, obviously you cannot send ^C to them. But - obviously - you can explicitly send signal to any process using the command kill. Background processes .... read man bash, look for job control.
And return back to your original post: exactly what did not work for you?
Do you realize that any earlier activity in the thread before your post, post #7, there was no activity in this thread since 2010?
Was there a new discovery which led to resurrecting this thread? Or was it an attempt to answer what you thought to be a current question?
Note that very old threads do not pull up the Quick Reply window and you have to click on the Post Reply button, and the next step is that LQ posts a notification:
Quote:
Please note that this thread has not been replied to in over 6 months. Please ensure your reply is still relevant and timely.
Repeated not in red coloring:
Quote:
Please note that this thread has not been replied to in over 6 months. Please ensure your reply is still relevant and timely.
Moderator note: I have split this thread from the old one. We prefer to have an up-to-date thread for different questions and you already have a quite high number of answers not related to the old one.
That's what I tried to explain. Desktop is not a terminal there is no way to identify the process to get the signal. (also graphical processes like editors use Ctrl-C Ctrl-V for copy and paste). In short you need to take care about the focus too.
Per pan64's comments. When started from the desktop there is no terminal attached to your script process. Therefore you need to run a terminal and observe the process list, then kill the script in that manner.
If you are looking for an automated way to kill a script, then please indicate that and people can suggest ways to write programs or scripts to do the seeking out for the script process and killing it. The most simplest script might be:
Code:
#Example process name my-script.sh
#!/bin/bash
killall my-script.sh
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.