105.1 Lesson 2 Flashcards
Where does a shell/local variable live?
In the shell in which they were created.
Where does an environment/global variable live?
In the shell where they were created and in children shells and/or processes.
Where do you configure variables, aliases and functions for a shell?
In startup files.
Accessing the value of a variable is called
variable referencing
How do you reference the variable distro?
$distro
Which characters may the name of a variable contain?
a-Z
A-Z
0-9
underscore _
What is wrong with the variable 1distro?
It starts with a number.
What is wrong with the variable “my distro”=zorinos?
It contains a space
The value of a variable is also called
reference
Which characters may the value of a variable contain?
a-z A-Z 0-9 most other characters $ ! * . / etc.
What is wrong with the following variable value?
distro=zorin 12.4
It contains a space and is not enclosed in quotes.
When must a variable value be enclosed in quotes?
When it contains < > or | (pipe symbol)
Are single and double quotes always interchangeable?
no
What do the semantics of single and double quotes depend on?
If they are used for assigning or for referencing
How do single quotes interpret characters of a variable’s value in the context of variable assignment?
literally