#!/bin/bashipaddr=`/sbin/ifconfig | tee tmp0.txt | grep 'inet 地址:' | tee tmp1.txt | grep -v '127.0.0.1' | tee tmp2.txt | cut -d : -f2 | tee tmp3.txt | awk '{print $1}'`echo $ipaddr~ ~ ~ ~ ~ ~
一个学习grep、tee、awk、cut命令的很好的示例脚本
最新推荐文章于 2023-08-05 11:55:58 发布