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

Running wsl <command> from windows command line is missing environment variables #7053

Closed
1 of 2 tasks
Mkassabov opened this issue Jun 10, 2021 · 2 comments
Closed
1 of 2 tasks
Labels

Comments

@Mkassabov
Copy link

Mkassabov commented Jun 10, 2021

Windows Build Number

10.0.19042 Build 19042

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.72

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

from the windows command line running

wsl echo $PATH

Expected Behavior

print the $PATH environment variable (e.g. echo $PATH from within wsl)

Actual Behavior

print an empty line

Diagnostic Logs

No response

@microhobby
Copy link

You need to use single quote to solve the WSL environment instead a Powershell variable. Example:

image

@therealkenc
Copy link
Collaborator

By-design Powershell. In the OP you've expanded $PATH (which expands to an empty string... except when it doesn't).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants