Chapter 22
Changing Environment Variables (export, Env:)

22.1 Do This


Source 41: Linux/Mac OSX Exercise 22
  $ export TESTING="bada bada bing"
  $ echo $TESTING
  bada bada bing
  $ unset TESTING
  $ echo $TESTING
  
  $ env | grep TESTING
  $


Source 42: Windows Exercise 22
  > get-childitem Env:
  
  Name                           Value
  ----                           -----
  APPDATA                        C:\Users\zed\AppData\Roaming
  COMPUTERNAME                   ZED-PC
  ...
  
  
  > $env:TESTING = "bada bada bing"
  > $env:TESTING
  bada bada bing
  > remove-item Env:\TESTING
  > get-childitem Env: | select-string TESTING
  >

22.2 You Learned This

You can also change an environment variable to something else, as well as unset it so it isn't in your environment at all. You can't set an environment variable to nothing ("") to remove it. You have to use a command.

22.3 Do More

  1. Take and list out all the environment variables you've found and then go look up what they are online.
  2. Read the man page for env again. What else can it do?


Online Video Course + PDF For $9

For the price of most other course's PDFs only, you can get the full PDF for this class and 2 videos demonstrating the whole book for both Unix/OSX Terminal and Windows PowerShell. The course is self-paced so you can go through it any time you want, as many times as you want.


Signup Now At Udemy.com For $9