On Oct 22, 2014, at 5:56, Niall O'Reilly <niall.orei...@ucd.ie> wrote:

> At Tue, 21 Oct 2014 22:31:28 -0500,
> Frank Bulk wrote:
>> 
>> Dave,
>> 
>> Thanks for the input, but what I was looking for was a dig command that
>> returns the IP(s) or a fail.  It looks like the host command is the right
>> solution in this case, not dig.
> 
>  Doesn't egrep fail on no match?

It does, but the cut at the end of the pipeline swallows it’s exit status

We can still get that though…

$ dig +noall +answer dave.knig.ht in a | egrep 'IN\tA\t' | cut -f6
216.235.14.46

$ echo ${PIPESTATUS[1]}
0

$ dig +noall +answer hopefully.this.does.not.exist in a | egrep 'IN\tA\t' | cut 
-f6

$ echo ${PIPESTATUS[1]}
1


That is if you’re using bash of course…

dave

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe 
from this list

bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to