bug-make
[Top][All Lists]
Advanced

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

Re: subst: Mention how to deal with a FROM that has commas in it


From: Gisle Vanem
Subject: Re: subst: Mention how to deal with a FROM that has commas in it
Date: Sat, 18 Mar 2023 12:32:11 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Dan Jacobson wrote:

(info "(make) Text Functions") says

'$(subst FROM,TO,TEXT)'
      Performs a textual replacement on the text TEXT: each occurrence of
      FROM is replaced by TO.  The result is substituted for the function
      call.  For example,

           $(subst ee,EE,feet on the street)

      produces the value 'fEEt on the strEEt'.

OK, but also do mention how to deal with a FROM that has commas in it.

It's mentioned somewhere else. And this works for me:

  comma := ,
  default:
     @echo '$(subst ee$(comma),EE$(comma),fee$(comma)t on the stree$(comma)t)'

producing 'fEE,t on the strEE,t'

--
--gv



reply via email to

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