Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.