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

Explain that $env is case-insensitive #1376

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions book/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ BAR
BAR
```

### Case sensitivity

Nushell's `$env` is case-insensitive, regardless of the OS. Although `$env` behaves mostly like a record, it is special in that it ignores the case when reading or updating. This means, for example, you can use any of `$env.PATH`, `$env.Path`, or `$env.path`, and they all work the same on any OS.

If you want to read `$env` in a case-sensitive manner, use `$env | get --sensitive`.

## Scoping

When you set an environment variable, it will be available only in the current scope (the block you're in and any block inside of it).
Expand Down