Re: Getting hostname
On 04-May-03, 17:28 (CDT), Bob Proulx <bob@proulx.com> wrote:
> host 193.99.144.71 | awk '/Name:/||/domain name pointer/{print$NF;exit}'
>
Oh, much better than mine.
> I rather like the 'dig' solutions posted by others. I really just
> posted this because I wanted to share the simple awk solution. But
> now I am thinking seriously of converting to the dig solution myself. :-)
Dig only works with DNS. The host solution works with /etc/hosts and
(probably) NIS. Depending on the application, this may be an issue.
Steve
--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net
Reply to: