安全问答

安全问答是一个知识全球问答,包含丰富的问答知识

首页 常规 游戏 娱乐 科技 程序员

写一段sh脚本判断能否ping通一个ip地址

  • 日期: 2025-08-21
  • 标签: 财经

#!/bin/bash

输入要ping的IP地址

read -p "请输入要ping的IP地址:" ip

判断是否可以ping通该IP地址

ping -c 3 $ip > /dev/null if [ $? -eq 0 ]; then echo "可以ping通该IP地址" else echo "无法ping通该IP地址" fi

退出脚本

exit 0

写一段sh脚本判断能否ping通一个ip地址

原文地址: https://www.cveoy.top/t/topic/dxF5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录

  • 上一篇: ‘Please ignore it if you have already done so’This sentence is modified in a more tactful and polite tone and is used for writing letters
  • 下一篇: 上海档案整理数字化公司推荐:专业服务,安全可靠

© 2019 • 2025 - 安全问答 站长邮箱:wxgpt@qq.com    ICP备案/许可证号:豫ICP备2024104334号-2