Adding upstream version 5.2.37.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
cf91100bce
commit
fa1b3d3922
1435 changed files with 757174 additions and 0 deletions
22
examples/functions/exitstat
Normal file
22
examples/functions/exitstat
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Contributed by Noah Friedman and Roland McGrath.
|
||||
|
||||
# To be run by the PROMPT_COMMAND variable, so that one can see what
|
||||
# the exit status of processes are.
|
||||
|
||||
function check_exit_status ()
|
||||
{
|
||||
local status="$?"
|
||||
local signal=""
|
||||
|
||||
if [ ${status} -ne 0 ] && [ ${status} != 128 ]; then
|
||||
# If process exited by a signal, determine name of signal.
|
||||
if [ ${status} -gt 128 ]; then
|
||||
signal="$(builtin kill -l $((${status} - 128)) 2>/dev/null)"
|
||||
if [ "$signal" ]; then signal="($signal)"; fi
|
||||
fi
|
||||
echo "[Exit ${status} ${signal}]" 1>&2
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
PROMPT_COMMAND=check_exit_status
|
Loading…
Add table
Add a link
Reference in a new issue