Dollar-signs in commands

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dollar-signs in commands

Daniel Kraft
Dear GNU make-team!

In a makefile I try to execute commands containing $-signs like this line of the
makefile:
        sabcmd XML/Inhalt.xsl Index.xml Index.html $$wurzel=de

I don't really know why, but this command doesn't set the
top-level-XSLT-parameter $wurzel to de, as it should. I tried copying this
command from what make displayed it was going to execute, and run it manually,
and it worked correctly. Do you know any problems with $-signs in commands, or
similiar things?

Many thanks,
yours,
Daniel Kraft



_______________________________________________
Make-w32 mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/make-w32
Reply | Threaded
Open this post in threaded view
|

Re: Dollar-signs in commands

Paul Smith-20
%% "Daniel Kraft" <[hidden email]> writes:

  dk> In a makefile I try to execute commands containing $-signs like
  dk> this line of the makefile:

  dk> sabcmd XML/Inhalt.xsl Index.xml Index.html $$wurzel=de

  dk> I don't really know why, but this command doesn't set the
  dk> top-level-XSLT-parameter $wurzel to de, as it should. I tried
  dk> copying this command from what make displayed it was going to
  dk> execute, and run it manually, and it worked correctly. Do you know
  dk> any problems with $-signs in commands, or similiar things?

Probably make is running a shell, like sh.exe or something.  In the
normal shell, $ introduces a shell variable.  So you have to use the
double $$ to quote it from make, then use a backslash or quotes to quote
it from the shell:

    sabcmd XML/Inhalt.xsl Index.xml Index.html \$$wurzel=de

Since you're using Windows it can be confusing to know what shell make
is using to invoke your command script, and how it's executed.  It
depends on how you've built make, etc.

--
-------------------------------------------------------------------------------
 Paul D. Smith <[hidden email]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Make-w32 mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/make-w32