find ./ -type f|grep conf$|xargs grep 'upstream k8s'
ping
#!/bin/sh
for i in $(cat host.txt)
do
ping -c 2 $i|grep -q 'ttl=' && echo "$i ok" || echo "$i failed"
done
ping-ip.py
import os
print (os.system)
def ping_ips():
ips=open('host.txt','r')
for ip in ips.readlines():
ip = ip.replace('\n','')
return1=os.system('ping -c 2 -w 1 %s'%ip)
print (return1)
ping_ips()
标签:脚本,常用,grep,ops,ip,ping,echo,ips,os
From: https://www.cnblogs.com/wl30564/p/16839328.html