[jamming] Naming a variable instead of expanding it

Vladimir Prus ghost at cs.msu.su
Tue Apr 5 05:44:01 PDT 2005


On Tuesday 05 April 2005 16:06, Arnt Gulbrandsen wrote:
> Hi,
>
> can any of you find a prettier way to do this?
>
> TEST = 1 ;
> TEST = "$" "(TEST)" ; TEST = $(TEST:J="") ;
> echo TEST is $(TEST) ;
>
> The desired output:
>
> TEST is $(TEST)
>
> If I try to express the assignment in a less hacky way, I invariably get
> wrong output, e.g.:

You can also use this:

   dollar = $ ;
   ECHO TEST IS $(dollar)(TEST) ;

which might be more convenient if you have many ECHOs of this kind. I'm not 
aware of any way to 'escape' the dollar sign.

HTH,
Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2



More information about the jamming mailing list