Ch.7 Seeing the World as the Shell Sees It Flashcards
What does echo do
Display a line of text
What is the mechanism by which wildcards work?
Pathname Expansion
What does Tilde Expansion do? What is the Tilde?
When used at the beginning of a word, it expands into the name of the home directory of the named user or, if no user is named, the home directory of the current user. ~
i.e.
echo ~
/home/pi
What form does Arithmetic expansion use?
$((expression))
Arithmetic expression only supports what?
Integers (Whole numbers, no decimals)
Arithmetic Expansion Description for Addiction
+
Arithmetic Expansion operation for subtraction
-
Arithmetic Expansion operation for multiplication
*
Arithmetic Expansion operation for division?
/
Arithmetic Expansion operation for remainder (modulo)
%
Arithemetic Expansion operation for Expnentiation
**
What expansion creates multiple text strings?
Brace Expansion {}
What may a brace expression contain in between {}?
Either a comma-separated list of strings 2. a range or intergers 3. single characters.
What is the leading portion of a pattern to be brace expanded?
preamble
What is the trailing portion of a pattern to be brace expanded?
postscript
What happens to text inside double quotes?
All the special characters used by the shell lose their special meaning and are treated as ordinary characters.
What keys are the exceptions to double quotes
$, \ (backslash) , ` (back-quote)
What Expansions are still carried out regardless of double quotes?
- parameter expansion 2. arithmetic expansion, 3. command substitution
What expansions are suppressed by double quotes?
- word-splitting 2. pathname expansion 3. tilde expansion, 4 brace expansion
How do we suppress all expansions?
Single Quotes
What is escaping characters?
when we don’t want a character to expand we precede a character with a backslash to selectively prevent an expansion