문제

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?

도움이 되었습니까?

해결책

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top