可以利用 stdout及stderr 處理 sleep 300 & echo $! > /tmp/pid & 2> 1 & #會將pid 記錄在/tmp/pid內 如果要刪除可以 kill $(cat /tmp/pid)