Environment variables


Displaying global variables –> “printenv” or “env” Displaying local variables –> “set”

Set a local variable : VARNAME="value"

Local vars only available in the current shell.

Set a global variable : export VARNAME="value"

Useful special bash variables : $? Exit status of the most recently executed foreground pipeline. $$ Process ID of the shell. $! Process ID of the most recently executed background command. $0 Expands to the name of the shell or shell script.

Many more here

Thanks for reading this post!

Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!