Hi,
In the book it talks about using powershell to set CASE_INSENSITIVE=1 to get the output:
"Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!"
What would the command be for linux terminal?
I have tried
$Env:CASE_INSENSITIVE=1; cargo run to poem.txt
But that only outputs two lines:
"Are you nobody, too?
How dreary to be somebody!"
I'm not sure what term to look up, or I would have.
which is also what's used in the book, a few lines further down.
Unlike the powershell command, this way the environment variable will also only be set for this single command, and not persist through the remainder of the session.
First thing to make sure is that you didn't misspell the name of the environment variable anywhere. You can also add
for v in std::env::vars() {
println!("{:?}", v);
}
into your program at some point to print out all avaliable environment vars and check whether CASE_INSENSITIVE is in there or missing.
And you could add dbg!(&case_sensitive); after the let case_sensitive = ... line to double-check whether the environment variable isn't recognized, or something else is wrong in the program logic.