I need to execute a command with timeout so it's killed after X time.
I have done tests and it only works when typed in the terminal directly, when in a bash script it seems to not handle the user input like it's not "receiving it"
I need to execute a command with timeout so it's killed after X time.
I have done tests and it only works when typed in the terminal directly, when in a bash script it seems to not handle the user input like it's not "receiving it"
I found a solution looking at the man page. You need to use timeout --foreground 120s
to have your command accept user input when executed in a bash script.