这是一个小练习。 shell代码如下:

#!/bin/bash

ifconfig | grep "inet 地址" | awk -F ':' '{print $2}' | awk '{print $1}'