tee管道
[root@centos7-1 ~]# ip addr |grep ‘inet ‘ |tee ip.txt |awk -F”/“ ‘{print $1}’ |awk ‘{print $2}’
127.0.0.1
192.168.122.205
[root@centos7-1 ~]# cat ip.txt
inet 127.0.0.1/8 scope host lo
inet 192.168.122.205/24 brd 192.168.122.255 scope global eth0
[root@centos7-1 ~]# ip addr |grep ‘inet ‘ |tee -a ip.txt |awk -F”/“ ‘{print $1}’ |awk ‘{print $2}’
127.0.0.1
192.168.122.205
[root@centos7-1 ~]# date |tee date.txt
2018年 11月 07日 星期三 14:50:04 CST
[root@centos7-1 ~]# cat date.txt
2018年 11月 07日 星期三 14:50:04 CST