linx shell ping

#!/bin/bash

for i in `seq 1 254`

do

  ping -c 1 192.168.72.$i > /dev/null

  if [ $? -eq 0 ]

  then

     echo: "192.168.72.$i存活"

  else

     echo: "192.168.72.$i不存活"

  fi

done

posted @ 2020-08-25 17:34  xiongmengdecrocodile  阅读(120)  评论(0)    收藏  举报