coreutils timeout and other timeout script i searched, they apply for a CDM
but i’d like to apply timeout for a linux script, if not finished for a period. like:
cd XXX && CMD && sleep 3 && kill -0 XX
How to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can pass the spawning of a subshell to timeout, and have the subshell run the code that needs to be timed out:
If you clarify what you need exactly there may be cleaner ways to achieve this.