Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing environment variable expansion in windows displays unexpected output #131

Open
gshively11 opened this issue Dec 6, 2016 · 1 comment
Labels
Platform: Windows Type: Bug Does not work as expected.

Comments

@gshively11
Copy link

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.

lamont-granquist added a commit that referenced this issue Feb 2, 2017
if we fix #131 then this would obviously go red and we'd need
 to fix it.

Signed-off-by: Lamont Granquist <[email protected]>
@lamont-granquist
Copy link
Contributor

that commit (i'll probably rebase it soon which will make the sha change but the most recent version should keep on getting posted to this issue) adds a test for the current behavior as to how we call CreateProcessW.

@tas50 tas50 added Platform: Windows Type: Bug Does not work as expected. labels Oct 28, 2019
lamont-granquist added a commit that referenced this issue Jul 16, 2020
if we fix #131 then this would obviously go red and we'd need
 to fix it.

Signed-off-by: Lamont Granquist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Windows Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

3 participants