2

I want to execute these two timeout command on the same command but with a different time and instructions. So

timeout --signal=SIGINT 5s command 
timeout --signal=SIGKILL 10s command

How to append them in one line?

3
  • timeout --signal=SIGKILL 10s { timeout --signal=SIGINT 5s command ; } or timeout --signal=SIGKILL 10s bash -c 'timeout --signal=SIGINT 5s command' ?
    – Costas
    Jan 18, 2015 at 15:34
  • I don't understand what "in one line" is supposed to mean as cmd1 ; cmd2 is probably not what you are looking for. If you need this structure often and want to reduce code then you can write a function which calls its parameter like the two example lines. Jan 18, 2015 at 17:35
  • 1
    no, I want if the first signal doesn`t work(in my command that is exactly the case) to kill it with the second signal(it works) Jan 18, 2015 at 21:26

1 Answer 1

5
timeout --signal=SIGKILL 10s timeout --kill-after=5 --signal=SIGINT 5s command

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .