Hi Bret,

Thank you for sharing your insight. It clearly looks like I will have to 
figure out an alternative approach to my batch files.

Context: Such batch files are created by FDNPKG, my FreeDOS package 
manager, as "links" to some commonly used applications like zip, upx, 
nasm, etc, to avoid having to put them all in a single directory within 
the %PATH% (and to avoid exploding the environment with a huge %PATH% 
containing dozens of directories). FDNPKG creates "link" files that are 
all stored in a dedicated directory on the disk, where each link file 
calls its parent application directly in the directory where said parent 
application is installed, passing the same arguments through %1 %2 %3...

This worked beautifully for me for years, until recently when I tried to 
compile things passing parameters like -DXX=YY to nasm.

Anyway, I will most probably have to work on some kind of small *.COM 
loader that would replace what I do with batches now... To be continued 
somewhere in the future.


On Tue, 29 Nov 2016 00:49:39 +0000, Bret Johnson wrote:
> The equals sign is "special" when the DOS shell is processing values
> from the command line, and different versions of DOS may treat it
> differently.  For example, in the FOR command it is basically treated as
> white space (the same as commas and real spaces).  At least in some
> versions of DOS, the following are equivalent:
> FOR %f in (1 2 3) DO DIR %f.EXE FOR %f in (1,2,3) DO DIR %f.EXE FOR %f
> in (1=2=3) DO DIR %f.EXE
> Also, you can't normally have an equals sign in any part of an
> environment variable (either its name or its contents), though you can
> sometimes manipulate things with double quotes to make it happen (with
> some versions of DOS, at least).
> You can also use an equals sign after ECHO with some versions of DOS to
> write an empty line:
> In your batch examples, the equals sign is not being treated as a switch
> character, it is be treated (sometimes) as white space.  There's no way
> your batch files will work consistently across different DOSes if you
> expect them to treat equals signs as "regular" characters.

Freedos-devel mailing list

Reply via email to