m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: confused by m4 esyscmd expansion ... how to 'escape' nested quotes?


From: Stepan Kasal
Subject: Re: confused by m4 esyscmd expansion ... how to 'escape' nested quotes?
Date: Fri, 5 Aug 2005 17:24:58 +0200
User-agent: Mutt/1.4.1i

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]