#!/bin/sh
# Ping网段所有IP

ip1=192.168.30.
ip2=192.168.31.
ip3=192.168.232.
for i in `seq 1 255`
do
ping -c 2 $ip1$i >> /dev/null
if [ $? == 0 ] ;then
echo "$ip1$i" >> /tmp/ip.txt
fi
ping -c 2 $ip2$i >> /dev/null
if [ $? == 0 ] ;then
echo "$ip2$i" >> /tmp/ip.txt
fi
ping -c 2 $ip3$i >> /dev/null
if [ $? == 0 ] ;then
echo "$ip3$i" >> /tmp/ip.txt
fi
done

linux-shell系列1-ip的更多相关文章

  1. Linux Shell系列教程之(十七) Shell文件包含

    本文是Linux Shell系列教程的第(十七)篇,更多Linux Shell教程请看:Linux Shell系列教程 通过文件包含,可以引用其他文件的内容,也可以将复杂内容分开,使程序结构更加清晰. ...

  2. Linux Shell系列教程之(十六) Shell输入输出重定向

    本文是Linux Shell系列教程的第(十六)篇,更多Linux Shell教程请看:Linux Shell系列教程 Shell中的输出和输入的重定向是在使用中经常用到的一个功能,非常实用,今天就为 ...

  3. Linux Shell系列教程之(十五) Shell函数简介

    本文是Linux Shell系列教程的第(十五)篇,更多Linux Shell教程请看:Linux Shell系列教程 函数可以将一个复杂功能划分成若干模块,从而使程序结构更加清晰,代码重复利用率更高 ...

  4. Linux Shell系列教程之(十四) Shell Select教程

    本文是Linux Shell系列教程的第(十四)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上一篇文章:Linux Shell系列教程之(十三)Shell分支语句case ...

  5. Linux Shell系列教程之(十三)Shell分支语句case … esac教程

    本文是Linux Shell系列教程的第(十三)篇,更多Linux Shell教程请看:Linux Shell系列教程 分支语句非常实用,基本上高级语言都支持分支语句(python 没有),大多数都使 ...

  6. Linux Shell系列教程之(十二)Shell until循环

    本文是Linux Shell系列教程的第(十二)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上两篇文章Linux Shell系列教程之(十)Shell for循环和Lin ...

  7. (转)Linux Shell系列教程之(十四) Shell Select教程

    本文属于<Linux Shell 系列教程>文章系列,该系列共包括以下 18 部分: Linux Shell系列教程之(一)Shell简介 Linux Shell系列教程之(二)第一个Sh ...

  8. Linux Shell系列教程

    学习Linux Shell知识,就来Linux大学网(Linuxdaxue.com)! 本系列适合Linux初学者,属于Linux入门级教程,主要介绍了Shell的分类.语法格式以及脚本的使用和编写格 ...

  9. Linux Shell系列教程之(十一)Shell while循环

    本文是Linux Shell系列教程的第(十一)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上一篇Linux Shell系列教程之(十)Shell for循环中,我们已经 ...

  10. Linux Shell系列教程之(十)Shell for循环

    本文是Linux Shell系列教程的第(十)篇,更多Linux Shell教程请看:Linux Shell系列教程 基本任何语言都有自己的循环语句,Shell当然也不例外,今天就为大家介绍下Shel ...

随机推荐

  1. Dedekind整环上的有限生成模的分类

    以下内容本想载于我的代数数论初步当中,但是与整体风格不符,所以换到这里来,为了排版上的方便,在注释掉之前用截图留存. 附:参考文献

  2. Leetcode 2. Add Two Numbers(medium)

    You are given two non-empty linked lists representing two non-negative integers. The digits are stor ...

  3. UnderWater+SDN论文之四

    Open Source Suites for Underwater Networking:WOSS and DESERT Underwater Source: IEEE Network, 2014 仿 ...

  4. vue-cli脚手架安装和webpack-simple模板项目生成

    vue-cli 是一个官方发布 vue.js 项目脚手架,使用 vue-cli 可以快速创建 vue 项目. GitHub地址是:https://github.com/vuejs/vue-cli 一. ...

  5. 【问题解决方案】之 hadoop 用jps命令后缺少namenode的问题

    用Xshell连接腾讯cloud里的虚拟机后,jps命令查无namenode导致过滤排序程序跑不起来,如图: 解决方案: Google之,说需要重启,格式化后再启动Hadoop.但鉴于本人不知道实现的 ...

  6. #Leetcode# 836. Rectangle Overlap

    https://leetcode.com/problems/rectangle-overlap/ A rectangle is represented as a list [x1, y1, x2, y ...

  7. vs快捷键 C#

    快速构建构造函数 输入 ctor 然后按 TAB 键 快速构建自动属性 在变量那里,右击鼠标,点“重构”--“封装字段” Visual Studio快捷键 [VS2008/VS2005] ****** ...

  8. mongoDB 安装和配置环境变量,超详细版本

    下载mongoDB进行安装:https://www.mongodb.com/                                                 到Community Se ...

  9. GRASP软件设计的模式和原则

    GRASP 模式:每一个模式描述了一个在我们周围不断重复发生的问题,以及该问题的解决方案的核心.”这是关于模式最经典的定义,作者是建筑大师Christopher Alexander.如果是第一次看到这 ...

  10. artTemplate精彩文章(个人阅读过)

    轻量级artTemplate引擎 实现前后端分离—基础篇 :https://www.imooc.com/article/20263 轻量级artTemplate引擎 实现前后端分离—语法篇 : htt ...