In article <mailman.1128.1414072988.26362.bind-us...@lists.isc.org>,
 Bob Harold <rharo...@umich.edu> wrote:

> Anytime you see 'grep' and 'cut' used together, they can usually be
> shortened to just 'awk', which requires starting one less process.  And if
> this case it splits fields the way a users sees them, so the same code
> works in both cases:
> 
> $ dig +noall +answer home.kreme.com in a | awk '/[\t ]A[\t ]/ {print $NF}'
> 23.24.150.141
> $ dig +noall +answer  dave.knig.ht in a | awk '/[\t ]A[\t ]/ {print $NF}'
> 216.235.14.46

$ dig +noall +answer cancer.ucs.ed.ac.uk | perl -ne ' /\sA\s/ && do { 
@_=split; print "$_[$#_]\n" }' 
129.215.166.13
129.215.200.7

Sam

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
_______________________________________________
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