make-w32
[Top][All Lists]
Advanced

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

Re: Passing quoted strings to bat files?


From: Eli Zaretskii
Subject: Re: Passing quoted strings to bat files?
Date: Fri, 01 Jul 2005 16:52:36 +0200

> From: "Angel Tsankov" <address@hidden>
> Date: Fri, 1 Jul 2005 15:47:57 +0300
> 
> I have a list of citations (e.g. citations = "This is citation 1" "This is 
> citation 2" "This is citation 3") and I want to pass this variable as the 
> first argument to a batch file. I've already tried this:
> 
> var := $(shell do_smth_with_citations.bat $(citations))     # does not work 
> as desired
> var := $(shell do_smth_with_citations.bat "$(citations)")   # does not work 
> as desired, either

Sorry, I don't understand what you are trying to do; would you please
tell more?

For example: why do you use $(shell) and assign the results to `var'?
What exactly is the role of do_smth_with_citations.bat in this story?
What is the shell that gets invoked when you call $(shell)?  Etc.,
etc.

FWIW, I tried this small test makefile:

--------------------- begin Makefile -------------------------------------
citations = "This is citation 1" "This is citation 2" "This is citation 3"

all:
        echo $(citations)
        cmd.exe /c echo $(citations)
--------------------- end Makefile ---------------------------------------

and got the expected output:

echo "This is citation 1" "This is citation 2" "This is citation 3"
"This is citation 1" "This is citation 2" "This is citation 3"
cmd.exe /c echo "This is citation 1" "This is citation 2" "This is citation 3"
"This is citation 1" "This is citation 2" "This is citation 3"

If you have a sh.exe (a Unixy shell) installed somewhere along the
Path, then you should get something like this:

echo "This is citation 1" "This is citation 2" "This is citation 3"
This is citation 1 This is citation 2 This is citation 3
cmd.exe /c echo "This is citation 1" "This is citation 2" "This is citation 3"
"This is citation 1" "This is citation 2" "This is citation 3"

That is, the first command has quotes removed.

A shot in the dark: does the following work for you:

   var := $(shell cmd.exe /c do_smth_with_citations.bat $(citations))

Is that what you want?  If not, what am I missing?




reply via email to

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