Customizing Your Computing Environment with Unix Commands
Completion requirements
View
3. Environment Variables
3.3. Exercise
Exercise
- List all of the environment variables set for your user environment.
- Create a new environment variable called MYFILE and set it equal to myfile.txt.
- Display the value of the environment variable MYFILE.
- Use the env command to list all of the environment variables set for your user environment.
- Depending on the shell you are using, you can create this variable and assign it a value by entering:
- setenv MYFILE "myfile.txt" (if using a C-type shell such as tcsh or csh)
- export MYFILE="myfile.txt" (if using a Bourne-type shell such as bash or ksh)
- Use the command 'echo $MYFILE'