指令 timeout 讓 command 時間到就停止
timeout 10s ping 8.8.8.8
或 利用背景模式加上 kill
ping 8.8.8.8 & sleep 10s; kill $!
參考 Linux run a command with a time limit (timeout)
指令 timeout 讓 command 時間到就停止
timeout 10s ping 8.8.8.8
或 利用背景模式加上 kill
ping 8.8.8.8 & sleep 10s; kill $!
參考 Linux run a command with a time limit (timeout)
留言