In Linux I would like to run a program but only for a limited time, like 1 second. If the program exceeds this running time I would like to kill the process and show an erro
Ah well. timeout(1).
timeout(1)
DESCRIPTION Start COMMAND, and kill it if still running after DURATION.