Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Dark

Collapse
Brand Logo

CIRCLE WITH A DOT

dos/windows batch files are so much fun.

Scheduled Pinned Locked Moved Uncategorized
5 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • foone@digipres.clubF This user is from outside of this forum
    foone@digipres.clubF This user is from outside of this forum
    foone@digipres.club
    wrote last edited by
    #1

    dos/windows batch files are so much fun.

    what does this output?
    SET FOO = BAR
    ECHO %FOO%

    foone@digipres.clubF 1 Reply Last reply
    0
    • foone@digipres.clubF foone@digipres.club

      dos/windows batch files are so much fun.

      what does this output?
      SET FOO = BAR
      ECHO %FOO%

      foone@digipres.clubF This user is from outside of this forum
      foone@digipres.clubF This user is from outside of this forum
      foone@digipres.club
      wrote last edited by
      #2

      it prints:

      %FOO%

      foone@digipres.clubF 1 Reply Last reply
      0
      • foone@digipres.clubF foone@digipres.club

        it prints:

        %FOO%

        foone@digipres.clubF This user is from outside of this forum
        foone@digipres.clubF This user is from outside of this forum
        foone@digipres.club
        wrote last edited by
        #3

        The reason? The space before the equals.

        SET FOO = BAR actually sets the environment variable "FOO " to " BAR"

        foone@digipres.clubF 1 Reply Last reply
        0
        • foone@digipres.clubF foone@digipres.club

          The reason? The space before the equals.

          SET FOO = BAR actually sets the environment variable "FOO " to " BAR"

          foone@digipres.clubF This user is from outside of this forum
          foone@digipres.clubF This user is from outside of this forum
          foone@digipres.club
          wrote last edited by
          #4

          yeah sure environment variables can have spaces in them, that's not a mistake that is just going to cause problems

          tml@mementomori.socialT 1 Reply Last reply
          0
          • foone@digipres.clubF foone@digipres.club

            yeah sure environment variables can have spaces in them, that's not a mistake that is just going to cause problems

            tml@mementomori.socialT This user is from outside of this forum
            tml@mementomori.socialT This user is from outside of this forum
            tml@mementomori.social
            wrote last edited by
            #5

            @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...

            1 Reply Last reply
            1
            0
            • R relay@relay.an.exchange shared this topic

            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups