#下载rpm包
wget -c http://repo.openfusion.net/centos7-x86_64/bat-0.7.0-1.of.el7.x86_64.rpm
#yum安装
yum install -y bat-0.7.0-1.of.el7.x86_64.rpm
#使用
bat ping.sh
#效果
[root@localhost ~]# bat ping.sh
───────┬──────────────────────────────────────────────────────────────────────────
│ File: ping.sh
───────┼──────────────────────────────────────────────────────────────────────────
1 │ #! /bin/bash
2 │ for ip in 192.168.199.{185..189};
3 │ do
4 │ ping -c2 $ip > /dev/null
5 │ if [ $? -ne 0 ];then
6 │ echo $(date +%F%T) $ip 异常>>/tmp/h.txt
7 │
8 │ fi
9 │ done
10 │
11 │
:
BAT安装(cat替代)
最新推荐文章于 2023-06-26 14:11:05 发布