例如跳板机可登录ip有下:
192.168.100.1
192.168.100.252
192.168.100.8
192.168.100.7
192.168.100.11
192.168.100.9
192.168.100.5
192.168.100.6
192.168.100.3
192.168.100.2
192.168.100.10
192.168.100.4
可使用循环语句查询每台机器:
for newcore_ip in 192.168.100.1 192.168.100.252 192.168.100.8 192.168.100.7 192.168.100.11 192.168.100.9 192.168.100.5 192.168.100.6 192.168.100.3 192.168.100.2 192.168.100.10 192.168.100.4; do echo -e "目标服务器:${newcore_ip}"; ssh -l log "${newcore_ip}" cat 目录/xxx.log.2020-08-19 |grep '条件'; done ;