Skip to content

Preventing environment variable expansion in windows displays unexpected output #131

@gshively11

Description

@gshively11

I tried to track down the root cause of this but was unable to in the time I had available.

In cmd.exe, running this echo %^COMPUTERNAME% outputs %COMPUTERNAME%

In mixlib/shellout, running

blah = Mixlib::ShellOut.new("echo %^COMPUTERNAME%")
blah.run_command.stdout

outputs %^COMPUTERNAME%. I would expect the carat to be removed like it is in cmd.exe.

The end result of this behavior is that I can't run commands that expected unexpanded environment variables as arguments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions