dos/windows batch files are so much fun.
-
dos/windows batch files are so much fun.
what does this output?
SET FOO = BAR
ECHO %FOO% -
dos/windows batch files are so much fun.
what does this output?
SET FOO = BAR
ECHO %FOO%it prints:
%FOO%
-
it prints:
%FOO%
The reason? The space before the equals.
SET FOO = BAR actually sets the environment variable "FOO " to " BAR"
-
The reason? The space before the equals.
SET FOO = BAR actually sets the environment variable "FOO " to " BAR"
yeah sure environment variables can have spaces in them, that's not a mistake that is just going to cause problems
-
yeah sure environment variables can have spaces in them, that's not a mistake that is just going to cause problems
@foone On Windows, you presumably get spaces in environment variable names presumably only by accident.
But an actually cursed by design thing is that there are standard environment variables that have parentheses in their names, "ProgramFiles(Arm)" and "ProgramFiles(x86)".
And then the build system for a certain complex open-source software (LibreOffice) actually needs the latter, but the way the build system is set up, it uses tools that import the environment in such a way that environment variables with cursed characters in their names get skipped...
-
R relay@relay.an.exchange shared this topic