Question

Here goes a simple two-level script:

test.sh

#!/bin/bash
timeout 100 ./test-inner.sh

test-inner.sh

#!/bin/bash
sleep 100000

And, executing

./test.sh

If I try to kill test.sh process by Control+C, it does not work. Could you help me out of here?

Était-ce utile?

La solution

Timeout program might had signal handler which could be configured by user with --foreground option. As you can see at it manual page:

   --foreground

          When not running timeout directly from  a  shell  prompt,  allow
          COMMAND  to  read from the TTY and receive TTY signals.  In this
          mode, children of COMMAND will not be timed out.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top