help with AWk

Len Conrad LConrad at Go2France.com
Sun Sep 28 03:08:01 UTC 2008


The logic desired if

If IP has no PTR, print "PTR_NUL", else print the PTR.


dig +short -x 1.2.3.4 | awk '{if ( $0 == "" ) {print "PTR_NUL" } else {print $0 } }'

... works if PTR exist, but if no PTR, PTR_NUL doesn't print.

thanks
Len





______________________________________________
IMGate OpenSource Mail Firewall www.IMGate.net



More information about the freebsd-questions mailing list