Topic 7 - Unix Shell Environments Flashcards
the full path name of your home directory
$HOME
the name of your login shell
$SHELL
the full path of the current working directory
$PWD
USER
the user name of the logged in user
TERM
the kind of terminal the user is using
DISPLAY
which X server to display on
PATH
the directories the shell should search to find a command
HOST
the name of e the computer you are using
REMOTEHOST
the name of the host logged-in from
MANPATH
the directories the man command should search to find man pages
Shell variable names can be made up of:
Alphabetical characters
Digits
Underscores
Shell variable names cannot begin with:
a digit
Shell variables can store either:
string of characters, or NULL
Shell variables can be accessed by putting a ____ in front of ____
putting a $ in front of their names. e.g., echo $HOME
Are variable names case-sensitive?
yes
What are the two kinds of shell variables?
Environmental variables (GLOBAL) & Regular Variables (LOCAL)
Define environmental variables
Affecting the current shell and the programs invoked from the shell.
Define regular variables
Affecting the current shell, but not the programs invoked from the shell
Which type of shells define their shell variables in each of the following:
- .profile
- .cshrc and .login
.profile = Bourne-Style shells
.cshrc and .login = C-Style shells
C-Style Shells: How do you set a variable?
set varname=varvalue
C-Style Shells: Clearing a regular (local) variable?
unset varname
C-Style Shells: How do you set environment variables?
setenv EnvironemntVarialbe EnvironemntValue No “=” sign here!
C-Style Shells: How do you clear environment variables?
unsetenv EnvironemntVariable
C-Style Shells: How do you list all environment shell variables?
Regular shell variables?
1) “printing” or “env”
2) “set” without any arguments