From 855aabd099d6b817ed95551425b4d3ad8d7a5b8d Mon Sep 17 00:00:00 2001 From: Ryan Willis Date: Mon, 1 Jun 2020 02:09:02 -0700 Subject: [PATCH] Update ch12-05 PowerShell note --- ci/dictionary.txt | 1 + src/ch12-05-working-with-environment-variables.md | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ci/dictionary.txt b/ci/dictionary.txt index fa7d0a0f..d1ba6379 100644 --- a/ci/dictionary.txt +++ b/ci/dictionary.txt @@ -69,6 +69,7 @@ chXX chYY clippy clippy's +cmdlet coercions combinator ConcreteType diff --git a/src/ch12-05-working-with-environment-variables.md b/src/ch12-05-working-with-environment-variables.md index 89c455fc..1cdb8f79 100644 --- a/src/ch12-05-working-with-environment-variables.md +++ b/src/ch12-05-working-with-environment-variables.md @@ -154,12 +154,18 @@ the word “to” in all lowercase: Looks like that still works! Now, let’s run the program with `CASE_INSENSITIVE` set to `1` but with the same query `to`. -If you’re using PowerShell, you will need to set the environment variable and -run the program in two commands rather than one: +If you're using PowerShell, you will need to set the environment +variable and run the program as separate commands: ```console -$ $env:CASE_INSENSITIVE=1 -$ cargo run to poem.txt +PS> $Env:CASE_INSENSITIVE=1; cargo run to poem.txt +``` + +This will make `CASE_INSENSITIVE` persist for the remainder of your shell +session. It can be unset with the `Remove-Item` cmdlet: + +```console +PS> Remove-Item Env:CASE_INSENSITIVE ``` We should get lines that contain “to” that might have uppercase letters: