Home:ALL Converter>kill bash script with wait command

kill bash script with wait command

Ask Time:2016-05-19T01:09:08         Author:Kishimo

Json Formatter

A bash script demo.sh

#!/bin/bash ./prog1 & ./prog2 & wait

Use timeout -s 9 5m demo.sh to run the script.

The script demo.sh used to be without & and wait. I want to know whether timeout will kill prog1 and prog2 when timeout happens. How can I make sure that all subprocesses would be killed?

Author:Kishimo,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37306090/kill-bash-script-with-wait-command
yy