Unix and Linux Discussions Tagged with exit status |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
6 |
9,027 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
5,911 |
Shell Programming and Scripting |
|
|
|
8 |
2,381 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
2,460 |
Shell Programming and Scripting |
|
|
|
14 |
8,802 |
Shell Programming and Scripting |
|
|
|
4 |
1,491 |
Shell Programming and Scripting |
|
|
|
2 |
3,595 |
Shell Programming and Scripting |
|
|
|
1 |
2,062 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
5,506 |
Shell Programming and Scripting |
|
|
|
6 |
4,492 |
Shell Programming and Scripting |
|
|
|
2 |
6,831 |
Shell Programming and Scripting |
|
|
|
5 |
97,656 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
46,242 |
Shell Programming and Scripting |
|
|
|
1 |
12,196 |
Shell Programming and Scripting |
|
|
|
1 |
8,480 |
HP-UX |
|
|
|
2 |
13,104 |
Shell Programming and Scripting |
|
|
|
7 |
50,330 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,228 |
Programming |
|
|
|
1 |
12,866 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
7,856 |
UNIX for Dummies Questions & Answers |
TIMEOUT(1) BSD General Commands Manual TIMEOUT(1)
NAME
timeout -- run a command with a time limit
SYNOPSIS
timeout [--signal sig | -s sig] [--preserve-status] [--kill-after time | -k time] [--foreground] <duration> <command> <args ...>
DESCRIPTION
timeout starts the command with its args. If command is still running after duration, it is killed. By default, SIGTERM. is sent.
--preserve-status Always exits with the same status as command even if it times out.
--foreground Do not propagate timeout to the command children.
-s sig, --signal sig Specify the signal to send on timeout. By default, SIGTERM. is sent.
-k time, --kill-after time Send a second kill signal if command is still running after time after the first signal was sent.
DURATION FORMAT
duration and time can be integer or decimal numbers. Values without unit symbols are interpreted as seconds.
Supported unit symbols are:
s seconds
m minutes
h hours
d days
EXIT STATUS
If the timeout was not reached, the exit status of command is returned.
If the timeout was reached and --preserve-status is set, the exit status of command is returned. If --preserve-status is not set, an exit
status of 124 is returned.
If command exits after receiving a signal, the exit status returned is the signal number plus 128.
If command is an invalid command, the exit status returned is 126.
If command is a non existing command, the exit status returned is 127.
If an invalid parameter is passed to -s or -k, the exit status return is 125.
SEE ALSO
kill(1), signal(3)
BSD
Oct 28, 2014 BSD