[comp.sys.ibm.pc] How can I pass equal signs into batch files?

scott@ubvax.UUCP (02/20/87)

--
Anybody know how an equal sign ("=") can be passed as part of a
parameter into a batch file?  (For those who don't know it, DOS batch
file processing changes tabs, commas, semicolons, and equals to a
space/blank in any parameter list!)

I have wanted to simplify my typing and also chain batch files which
eventually call MAKE.  More often than not, MAKE parameters involve
equals....  You get the picture.

I have managed to patch COMMAND.COM around this, but was wondering if
there's a "proper" solution.  Can the "=" be quoted in some way?

I'm currently using PC DOS 3.10.
-- 
"Ribbit!"     Scott (Beam Me Up, Scotty!) Scheiman   Industrial Networking Inc.
  `/\/@\/@\/\       ..decvax!amd!ubvax!scott           3990 Freedom Circle
  _\ \ -  / /_           (408) 562-5572                  Santa Clara, CA 95050

kneller@ucsfcgl.UUCP (02/21/87)

In article <648@ubvax.UUCP> scott@ubvax.UUCP (Scott Scheiman) writes:
>--
>Anybody know how an equal sign ("=") can be passed as part of a
>parameter into a batch file?  (For those who don't know it, DOS batch
>file processing changes tabs, commas, semicolons, and equals to a
>space/blank in any parameter list!)
>
>I'm currently using PC DOS 3.10.
>-- 

Funny you should use "=", since that is how you can pass those illegal
characters.  You can also `protect' > < | with double quotes.  The
double quotes do not get stripped from the argument list.

Yes, double quotes are documented somewhere in the DOS manual.  Now can
we please drop the "RTFM" crap?  It is obvious there are inconsistencies
across DOS manuals and not everyone has every manual.  For the uninitiated,
RTFM is "read the f* manual" and is derogatory no matter how it's said.
	Don Kneller
UUCP:	...ucbvax!ucsfcgl!kneller
ARPA:	kneller@cgl.ucsf.edu
BITNET:	kneller@ucsfcgl.BITNET

scott@ubvax.UUCP (02/23/87)

In article <10074@cgl.ucsf.edu.ucsfcgl.UUCP>, kneller@socrates.ucsf.edu (Don Kneller%Langridge) writes:
> In article <648@ubvax.UUCP> scott@ubvax.UUCP (Scott Scheiman) writes:
> >--
> >Anybody know how an equal sign ("=") can be passed as part of a
> >parameter into a batch file?  (For those who don't know it, DOS batch
> >file processing changes tabs, commas, semicolons, and equals to a
> >space/blank in any parameter list!)
> >-- 
> 
> Funny you should use "=", since that is how you can pass those illegal
> characters.  You can also `protect' > < | with double quotes.  The
> double quotes do not get stripped from the argument list.
> 
> Yes, double quotes are documented somewhere in the DOS manual.  Now can
> we please drop the "RTFM" crap?  It is obvious there are inconsistencies
> across DOS manuals and not everyone has every manual.  For the uninitiated,
> RTFM is "read the f* manual" and is derogatory no matter how it's said.

Thanks for your reply, but I'm sorry to say this is only close--no
ceegar:

Yes, quotes (") `protect' > < and |, and stay around too, just as you
say (if I ever really needed to pass > < or | to a batch file I'd very
likely consider it quite a nuisance that the quotes do not get
stripped).  My version of the DOS 3.10 Reference (1st ed., Feb. 1985),
however, seems to make no mention of quoting these chars, and in fact
states (p. 7-12):  "If you type any of these characters <, >, or | in a
command, DOS treats them as redirection and piping characters."

Now for the real kicker:  quotes do not work at all around equal, comma,
semicolon, space or tab.  I've tried every kind of quote or escape
character I can think of--these characters always disappear.  If you (or
anyone else) have successfully passed an equal sign into a batch file,
I'd appreciate it if you'd tell me precisely how.

I agree with your admonition against "RTFM".  I, too, find much of the
current "mood" of the net disturbing.
-- 
"Ribbit!"     Scott (Beam Me Up, Scotty!) Scheiman   Industrial Networking Inc.
  `/\/@\/@\/\       ..decvax!amd!ubvax!scott           3990 Freedom Circle
  _\ \ -  / /_           (408) 562-5572                  Santa Clara, CA 95050