[comp.os.msdos.programmer] Passing delimiters to a batch file

bank@lea.ncsu.edu (Dave The DM) (11/04/90)

   The only idea that occurs offhand is kinda half-arsed, but if
it'll fill your needs.....


   If you want "foo(3,5)", try using some character that DOS
ignores, such as the ";". Then write your program such that
it recognizes the ";" and automagically replaces it with

a ",".

    Just an idea....

                                Dave the DM

                                bank@lea.csc.ncus.edu

TOMIII@MTUS5.BITNET (Thomas Dwyer III) (11/05/90)

How about:

echo %1,%2
echo %3


Thomas Dwyer III                        Email: tomiii@mtu.edu
Network Programmer                             tomiii@mtus5.BITNET
Computing Technology Services           Voice: (906) 487-2110
Michigan Technological University       Fax:   (906) 487-2787

scott@ubvax.UB.Com (Scott Scheiman) (11/08/90)

In article <60564@bbn.BBN.COM> sher@BBN.COM (Lawrence D. Sher) writes:
>I want to be able to call a batch file with arguments that contain
>commas.  This over-ambitious goal has led me to discover that DOS uses
>both spaces and commas (and any contiguous collection thereof) as
>delimiters between arguments.

I worked up a patch to COMMAND.COM a number of years ago so that it
doesn't treat comma like a space.  Of course, such an approach treats
all commas this way, not just going to batch parameters, and it isn't
portable.

(I needed this ability to pass commas because I wanted to call MAKE from
a batch file, passing its parameters into the batch file, and MAKE
requires commas in some parameters.  Shame on the DOS design.)

Someone wanted this a while back, so I made a posting like this one saying I
would make my patch available.  I got about 6 mail requests for it, so I
decided to post it.  I have no idea how many people have since tried it.
I did have some email interaction with someone who found an obscure
side-effect that he didn't like (for which I had no workaround).  I
suspect I still have records of our email about that problem, but right
now my memory fails.

My patch was for DOS version 3.1.  However, I describe it in context
(use DEBUG to find code that looks right and put the patch there) so
it's likely it can be applied to many DOS versions, at least the 3.x
versions.  Who knows if the 4.x versions have diverged too far...?

OS/2 command interpreter has implemented an escape character which might
work in your case -- but who has OS/2 (except me)?
--
Special Guest .Signature:
    "Irresponsibility is not a sickness--it's an art!"    -- R. Steele

"Ribbit!"         Scott Scheiman   (408) 562-5572        Ungermann-Bass, Inc.
  ` /\/@\/@\/\           scott@ubvax.UB.Com          2560 Mission College Blvd.
   _\ \ -  / /_         ...uunet!ubvax!scott            Santa Clara, CA 95054