运维网's Archiver
论坛
›
Shell/Powershell
› 【Linux-shell】shell脚本基础语法练习
ycvodzf
发表于 2018-8-29 08:22:24
【Linux-shell】shell脚本基础语法练习
#!/bin/bash
for ip in 192.168.1.{1..255} ;
do
ping $ip -c 2 &> /dev/null ;
if [ $? -eq 0 ];
then
echo $ip is alive
fi
done
页:
[1]
查看完整版本:
【Linux-shell】shell脚本基础语法练习