3-Configurig Bash Shell Flashcards
is a name or identifier that can e assignment a value
variable
how to declare a local variable:
varname=”value”
is a variable that is only available to the shell in which it was created.
local variable
is available to the shell in which it was created, and it is passed into all other commands/programs started by the shell.
environment variable
how to print a local variable:
echo $varname
how to declare an environment variable:
export VARNAME=”value”
note: variable name should be in caps
how to print an environment variable:
echo $VARNAME
If you create a variable and then no longer want that variable to be defined, use the _______ command to delete it
unset
example:
unset VARIABLE
(no output will be displayed)
The _______ variable is one of the most critical environment variables for the shell, so it is important to understand the effect it has on how commands will be executed.
PATH
The _______ variable contains a list of directories that are used to search for commands entered by
the user.
PATH
specifies the location of a file or directory from the top-level directory through all of the subdirectories to the file or directory.
absolute path
always start with the / character representing the root directory. For example, /usr/bin/ls
absolute path
[skee@localhost ~]$ /home/skee/welcome.sh
The example above is a _______ path
absolute
specifies the location of a file or directory relative to the current directory. For example, in the /home/sysadmin directory, a relative path of test/newfile would actually refer to the /home/sysadmin/test/newfile file.
relative path
[skee@localhost ~]$ ./welcome.sh
The example above is a _______ path
relative