help-gnu-utils
[Top][All Lists]
Advanced

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

Re: m4 and newlines?


From: Steve Calfee
Subject: Re: m4 and newlines?
Date: Fri, 29 Oct 2004 11:17:11 -0700

On Fri, 29 Oct 2004 15:08:14 -0000, Mike <mikee@mikee.ath.cx> wrote:

>I have a macro working:
>
>define(`domain', `ifelse($#, 0, , $#, 1, ``domain $1'', ``domain' $1 
>domain(shift($@))')')
>domain(`a', `b', `c')
>
>that returns:
>
>domain a domain b domain c
>
>I want it to return:
>
>domain a
>domain b
>domain c
>
>How do I cause a newline? I tried define(`newline', `esyscmd(echo)'), but
>that didn't seem to do right.
>
>Mike
#newlines for m4 are put in the text string in the definition

define(`domain', `ifelse($#, 0, , $#, 1, ``domain $1'', ``domain' $1
domain(shift($@))')')

domain(`a', `b', `c')
domain a
domain b
domain c

#you also have an unneeded test in the domain macro:
define(`domain', `ifelse($#, 1, ``domain $1'', ``domain' $1
domain(shift($@))')')

domain(`a', `b', `c')
domain a
domain b
domain c




reply via email to

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