标签:
#!/bin/bash
hostname
ip=`/sbin/ifconfig eth0|grep "inet addr:"|sed ‘s/Bcast.*$//‘g |awk -F ":" {‘print $2‘}`
dns=`cat /etc/resolv.conf |grep -v ‘#‘|sed ‘s/nameserver//‘`
for i in $ip
do
echo "$i"
done
for a in $dns
do
echo "$a"
done
shell_script_查询主机名、ip地址 、DNS地址
标签:
原文地址:http://www.cnblogs.com/Nyan-Workflow-FC/p/5304654.html