企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## seq 设置起始增量 ``` #!/bin/bash PREFIX=192.168.1. for i in `seq 100 110` do echo -n "${PREFIX}$i " ping -c5 ${PREFIX}${i} >/dev/null 2>&1 if [ "$?" -eq 0 ];then echo "OK" else echo "Failed" fi done ``` 执行 ``` jelly@X:~$ bash ping.sh 192.168.1.100 Failed 192.168.1.101 Failed 192.168.1.102 OK 192.168.1.103 OK 192.168.1.104 OK 192.168.1.105 OK 192.168.1.106 Failed 192.168.1.107 Failed 192.168.1.108 Failed 192.168.1.109 Failed 192.168.1.110 Failed ```