Preventing environment variable expansion in windows displays unexpected output
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- cli, operating-systems
Research direction
The behavior is exposed through Mixlib::ShellOut in mixlib/shellout; start by tracing how Windows commands are executed and how stdout is collected. Compare echo %^COMPUTERNAME% with cmd.exe, then verify that the caret is removed while the environment variable remains unexpanded.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Ruby
- Stars
- 133
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from chef/mixlib-shellout
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
chef/mixlib-shellout#287 ·
-
Status: Untriaged Type: Bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
chef/mixlib-shellout#278 ·
-
Status: Untriaged Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
chef/mixlib-shellout#257 ·
-
Status: Untriaged
Difficulty 4/5 3-5 days Newbie friendliness 35/100
chef/mixlib-shellout#245 · 2 comments ·
-
Status: Untriaged Type: Bug
Difficulty 4/5 3-5 days Newbie friendliness 20/100
chef/mixlib-shellout#237 · 1 comment ·
All issues in chef/mixlib-shellout
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
thewca/worldcubeassociation.org#16088 ·
Maintainers usually reply within 1 day
-
cocoapods: bundled activesupport raises `unknown keyword: quirks_mode` once json 3 is installedOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Homebrew/homebrew-core#319232 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ecosyste-ms/repos#1215 ·
Maintainers usually reply within 1 day