timeout runs the given command and kills it if it is still running after the specified time interval. Synopsis:
timeout [option] duration command [arg]...
command must not be a special built-in utility (see Special built-in utilities).
The program accepts the following options. Also see Common options. Options must precede operands.
Note in this mode of operation, any children of command
will not be timed out.
duration is a floating point number followed by an optional unit:
‘s’ for seconds (the default) ‘m’ for minutes ‘h’ for hours ‘d’ for days
A duration of 0 disables the associated timeout. Note that the actual timeout duration is dependent on system conditions, which should be especially considered when specifying sub-second timeouts.
124 if command times out
125 if timeout itself fails
126 if command is found but cannot be invoked
127 if command cannot be found
137 if command is sent the KILL(9) signal (128+9)
the exit status of command otherwise