wait but kill if a max. time was exceeeded

From: Gorka Lertxundi <glertxundi_at_gmail.com>
Date: Thu, 23 Apr 2015 17:41:00 +0200

I have a very simple question, is it possible in execline to wait up to a
maximum amount of time to finish a background program execution? And if it
didn't finish, kill it forcibly?

Something like this:

background
{
  whatever...
}
wait -t ${MAX_TIME} { ${!} }
foreground { kill -9 ${i} }
prog

Or how can I achieve this behaviour?

Thanks!
Received on Thu Apr 23 2015 - 15:41:00 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC