Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #1060

Re: Batch file replaceable parameters

From pete@nospam.demon.co.uk
Newsgroups comp.os.msdos.programmer
Subject Re: Batch file replaceable parameters
Date 2013-11-14 07:30 +0000
Organization PDL
Message-ID <1384414228snz@nospam.demon.co.uk> (permalink)
References <l61eus$cmi$1@speranza.aioe.org> <52844f28$0$9303$703f8584@textnews.kpn.nl> <l61k03$lqc$1@speranza.aioe.org>

Show all headers | View raw


On 14th Nov 2013 at 15:35 "Ed" <invalid@invalid.com> wrote:

> Sjouke Burry wrote:
> > On 14.11.13 4:09, Ed wrote:
> > > Is it possible to pass the following string as a replaceable parameter in 
> a Batch file?
> > >
> > >      STUFF=8
> > >
> > > Batch appears to treat  =  as a delimiter and the result is two parameters 
> - "STUFF" and
> > > "8". Is there any way to circumvent this?
> > >
> > >
> > >
> > Maybe try   "stuff=8"    with the quotes?
> 
> Tried that (MS-DOS 7).  Didn't help.
> 
> It's not a big issue since, if need be, I can create multiple versions of the
> batch file and hard-code the string into the one's I wanted.  Just curious
> whether there was a way to input such strings.

Looking at Timo Salmi's BATFAQ (TSBAT71.ZIP from garbo if it's still 
there) it seems that this simply isn't possible in batch without help 
from an auxilliary program.

Incidentally, while I was experimenting in dos 6.22 before remembering 
about Timo's bat utils, I also discovered that batch does a similar 
thing with commas.  So "1,2" as a parameter to the batch file arrives 
as 2 parameters (though curiously you can set an env var with a comma 
in it, e.g. set "stuff=1,2" behaves as you would think).

Pete
-- 
Believe those who are seeking the truth.
Doubt those who find it.  -  André Gide

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 14:09 +1100
  Re: Batch file replaceable parameters Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2013-11-14 05:18 +0100
    Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 15:35 +1100
      Re: Batch file replaceable parameters pete@nospam.demon.co.uk - 2013-11-14 07:30 +0000
        Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-14 19:19 +1100
      Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-18 10:53 +0100
        Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-19 20:00 +1100
          Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-19 19:31 +0100
            Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-21 23:07 +1100
              Re: Batch file replaceable parameters "R.Wieser" <address@not.available> - 2013-11-21 17:39 +0100
      Re: Batch file replaceable parameters Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2013-11-18 11:48 +0100
        Re: Batch file replaceable parameters pete@nospam.demon.co.uk - 2013-11-18 20:19 +0000
        Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-19 20:02 +1100
  Re: Batch file replaceable parameters Herbert Kleebauer <klee@unibwm.de> - 2013-11-14 09:39 +0100
    Re: Batch file replaceable parameters "Ed" <invalid@invalid.com> - 2013-11-17 12:41 +1100

csiph-web