replace "ps --pid $kpid" with "ps -p $kpid" to be posix-compliant