Need to grep /etc/hosts with a known hostname, and then capture the ip address for the hostname from /etc/hosts
问题 Need to grep /etc/hosts with a known hostname, and then capture the ip address for the hostname from /etc/hosts. I am not a programmer, and don't know how to go about this. I have very limited experience with regex, but think that this might work somehow. I am not using DNS, just managing with /etc/hosts file. I need to grep the /etc/hosts file with the known hostname, and then capture the IP address for the hosts entry. The host file is standard format: Please help! UPDATE: # Maintenance