object=$(ls /etc/sysconfig/network-scripts/ifcfg-* | grep -v [*.*] | cut -d
"/" -f 5 | cut -d "-" -f 2)
for tmp in $object
do
doing=$(ip address show $tmp | grep 'inet' | grep -v 'inet6')
IPv4=$doing| awk '{print $2}'
echo $IPv4
done
我想要在第六行IPv4=$doing| awk '{print $2}'在切割一次
但這樣抓不到值 如何利用變數在執行一次awk之後再存入變數
python寫太習慣轉不過來...