Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I execute (in an interactive bash shell) a loop that spawns a bunch of processes in sequence, such as the following.

for i in `seq 15 42`; do if [ -f F$i.flv.mp3 ]; then play F$i.flv.mp3; fi; done 

If I kill the current process with Control-C, it will just go to the next process in the loop, and I have to kill the processes started by an iteration of the loop separately.

Without killing my interactive shell, can I stop the loop from generating or more processes in sequence?

share|improve this question

In my tests Control-C breaks the loop, but if it didn't, I'd do a Control-Z to stop the job, and then kill %1 to kill the whole job.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.