I want to run a few commands, each of which doesn\'t quit until Ctrl-C is pressed. Is there something I can run to run all of them at once, and Ctrl-C will quit them all? Th
It can be done with simple Makefile:
sleep%:
sleep $(subst sleep,,$@)
@echo $@ done.
Use -j option.
$ make -j sleep3 sleep2 sleep1
sleep 3
sleep 2
sleep 1
sleep1 done.
sleep2 done.
sleep3 done.
Without -j option it executes in serial.
$ make -j sleep3 sleep2 sleep1
sleep 3
sleep3 done.
sleep 2
sleep2 done.
sleep 1
sleep1 done.
You can also do dry run with `-n' option.
$ make -j -n sleep3 sleep2 sleep1
sleep 3
sleep 2
sleep 1