Hello,

On Fri, Aug 05, 2005 at 07:52:24AM -0700, OpenMacNews wrote:
> Is there a way to NOT include the newline?

since you already use awk, it's probably best to use printf instead of print.

And awk can also search for the right line.  If I understand the
format of the output of DiG correctly, it would be

    changequote([,])
    define([MY_IP_ADDR],
          esyscmd([dig @my.ns.domain.com machine.domain.com |
                awk 'index($ 0, "machine.domain.com") == 1 {
                        printf("%s", $ 5) }']))

Portability notes:

This will work with any reasonable awk.

Warning: Solaris' /bin/awk is not reasonable, so this might fail.
In that case, you might try try /bin/nawk, it's better.
Most instalations of Solaris', but not all, have a reasonable awk
under /usr/xpg4/bin/awk.

Other unices have reasonable awk under /bin/awk, I think.

Enjoy,
        Stepan


_______________________________________________
M4-discuss mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-discuss

Reply via email to