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: OpenMacNews
Subject: Re: confused by m4 esyscmd expansion ... how to 'escape' nested quotes?
Date: Fri, 05 Aug 2005 07:52:24 -0700

hi stepan,

thx 4 the reply! =)

To conclude, I suggest:

define(`MY_IP_ADDR',
       esyscmd(`dig @my.ns.domain.com machine.domain.com |
                grep machine.domain.com | grep -v DiG |
                grep -v ";"machine.domain.com | awk "{print $ 5}"'))

this suggestion now correctly expands to the IP, without the error i'd mentioned,

BUT, it throws-in an unwanted <CR> after the expansion ... which, per:

   <http://developer.apple.com/documentation/DeveloperTools/m4/m4_12.html>

is apparently NOT unexpected ...

  "Note how the expansion of esyscmd has a trailing newline."

Is there a way to NOT include the newline?

also, i have no problem using/defining:

   changequote([,])

which, upon changing your suggestion to:

   changequote([,])
   define([MY_IP_ADDR],
         esyscmd([dig @my.ns.domain.com machine.domain.com |
                grep machine.domain.com | grep -v DiG |
                grep -v ";"machine.domain.com | awk '{print $ 5}']))

also works nicely -- even with the awk single-quote now.

thx again!

cheers,

richard




reply via email to

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