Skip to content

ronaldxs/bash-timeout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

timeout - Send a TERM (or other) signal after a specified duration to a command if it has not already completed. Attempt to replicate GNU timeout with bash function if check for GNU timeout fails. The duration is passed to "sleep" and so can be any value accepted by your system sleep command.

SYNOPSIS

$ timeout 2 bash -c 'echo abc; sleep 3; echo def'
abc
$ echo $?
124

Switches

  • -p

    Preserve exit code from signalled process. If bash timeout tried to end its command with a signal after the timeout duration then the exit code is normally 124. The -p option requests that bash timeout use the exit code of the signalled process which should usually be 128+(signal number).

  • -s

    Alternative signal to be passed to kill if you want a signal other than TERM after the duration expires. Again any value accepted by your system kill should work but do not pass a leading '-' (so -sINT and not -s-INT).

About

bash implementation of gnu timeout

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published