#!/bin/bash ip=$(host -W 5 $1 | grep 'has address' | cut -d' ' -f4) echo $ip