I am having trouble understanding shell script below. Specifically, what is Kill -0 (zero)
while kill -0 ${docker_pid} 2>/dev/null do #do something here done All the documentation for kill signals I have found starts documenting from 1...31
#ifndef _POSIX_SOURCE #include <machine/trap.h> /* codes for SIGILL, SIGFPE */ #endif /* _POSIX_SOURCE */ #define SIGHUP 1 /* hangup */ #define SIGINT 2 /* interrupt */ #define SIGQUIT 3 /* quit */ #define SIGILL 4 /* illegal instruction (not reset when caught) */ #ifndef _POSIX_SOURCE #define SIGTRAP 5 /* trace trap (not reset when caught) */ #endif ... signal.h continues .... 1 Answer
kill -0 <pid> just gives a return value 0 if the process exists, and 1 if it doesn't.