From 6accb38c54b701bfa45391e426906e356ef3efe6 Mon Sep 17 00:00:00 2001 From: YizhePKU Date: Tue, 30 Apr 2024 20:55:24 +0800 Subject: [PATCH] Explain that $env is case-insensitive --- book/environment.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/book/environment.md b/book/environment.md index 44f7114aeca..9209b20795e 100644 --- a/book/environment.md +++ b/book/environment.md @@ -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).