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

Uppercase only the PATH env variable #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

claudiubelu
Copy link

busybox's env behaves differently, depending on how it is
called:

busybox.exe env # env variable names casing is preserved.

or

busybox.exe sh -c "env" # env variable names are uppercased.

But env on Linux preserves the casing, and so should busybox,
with the exception of the PATH variable, which must be uppercased,
otherwise the default value will be used instead, which can lead to
commands not being found.

busybox's env behaves differently, depending on how it is
called:

busybox.exe env  # env variable names casing is preserved.

or

busybox.exe sh -c "env"  # env variable names are uppercased.

But env on Linux preserves the casing, and so should busybox,
with the exception of the PATH variable, which must be uppercased,
otherwise the default value will be used instead, which can lead to
commands not being found.
@rmyorston
Copy link
Owner

It isn't env that's behaving differently, it's the shell. env always preserves the case of environment variables.

When the busybox-w32 shell is started it loads the Windows environment variables into shell variables, converting their names to uppercase. When env is run from the shell the shell variables are placed in its environment.

I think converting the environment variable names to uppercase is the correct thing to do. (It's also how Python handles this issue.)

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

Successfully merging this pull request may close these issues.

2 participants