damoon / timeoutput

Timeoutput stops a command when it does not create output for a specified time or takes longer to run then some other time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

timeoutput

Limits the execution time of a command.

Go Report Card

Usage

timeoutput <global timeout> <output timeout> <command>...

The maximum execution time is limited by the first parameter.
The maximum time between outputs to stderr or stdout is limited by the second parameter.
All following arguments are interpreted as the command to execute.

The exit code is none zero for timeouts and forwards the exit code from the executed command otherwise.

Example

command

./timeoutput 10 2 bash -c "while sleep 1; do echo hello; done"

output

hello
hello
hello
hello
hello
hello
hello
hello
hello

Installation

go get github.com/damoon/timeoutput

About

Timeoutput stops a command when it does not create output for a specified time or takes longer to run then some other time.

License:MIT License


Languages

Language:Go 100.0%