sh function: process.wait() to avoid zombie attack