dig: single line

Mike -- EMAIL IGNORED m_d_berger_1900 at yahoo.com
Wed Mar 11 23:32:02 UTC 2009


On Thu, 12 Mar 2009 09:30:00 +1030, Tim wrote:

> On Wed, 2009-03-11 at 22:18 +0000, Mike -- EMAIL IGNORED wrote:
>> Is there a way to get dig to return at most one line?  For example (on
>> FC7), :
>> 
>>    #dig +short +search +nomultiline www.ieee.org a165.g.akamai.net.
>>    204.2.177.34
>>    204.2.177.41
>> 
>> is not exactly "nomultiline".
> 
> I don't think nomultiline does what you think it does.  I suspect, from
> reading the man file, it's about individual records that have multiline
> outputs, not whole query answers that do.  e.g. If a single record, like
> the "a165.g.akamai.net" data, had more information directly associated
> with it.
> 
> But, whatever it actually means, you could tag the following onto the
> end of your command line:  |head -n 1
> 
[...]

I reread the man page, and I agree that +nomultiline is not what I
want. The head suggestion won't work, because in the above example,
it is the second line I want.

Failing a better suggestion, I'll just have to parse the output.
Perhaps I will test each line with inet_aton until I get one that
works.  I was hoping to avoid that.

Mike.




More information about the fedora-list mailing list