Skip to content

Commit

Permalink
update w01 notes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmar3 committed Jan 21, 2022
1 parent 1a685db commit 52876c9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions content/w/01.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,34 @@ https://comp426-2022-spring.github.io/slides/w01-01.html
[JavaScript Variables – A Beginner's Guide to var, const, and let](https://www.freecodecamp.org/news/javascript-variables-beginners-guide/) - Madison Kenna

[Arrow functions for beginners](https://codeburst.io/javascript-arrow-functions-for-beginners-926947fc0cdc) - Brandon Morelli

### Notes

In class today, I was trying to set environment variables so that we could see what happened when we used one instead of letting the basic webserver use its default, but `setenv` wasn't working.

This is because `setenv` doesn't belong to `bash`.
It belongs to a different shell.
I was recently working on a system using `tcsh` instead of `bash` and those commands got stuck in my head.

The correct commands for setting (and viewing) an environment variable called PORT are below:

```bash
# `export` will set an environment varialble
export PORT=5000

# If set, the following should give you the value saved in the variable:
echo $PORT

# To see an environmental variable you can call `env` and pipe it through `grep`
env | grep PORT

# `env` without any options will put ALL environment variables into STDOUT.
env

# `env` will set a variable similarly to `export` above and then put all environment variables into STDOUT
env PORT=5000

# You can un-set a variable with `env` as well
env -u PORT
env --unset PORT
```

0 comments on commit 52876c9

Please sign in to comment.