码迷,mamicode.com
首页 > 系统相关 > 详细

生产环境中shell

时间:2019-09-27 14:54:42      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:done   one   txt   bash   生产环境   shell   bin   else   null   

#!/bin/bash

for i in `seq 1 254`

do

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

  if [ $? -eq 0 ]

  then

    echo "192.168.238.$i存活"

  else

    echo "192.168.238.$i不存活" >> /root/a.txt

  fi

done

生产环境中shell

标签:done   one   txt   bash   生产环境   shell   bin   else   null   

原文地址:https://www.cnblogs.com/sjzz/p/11597860.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!