Bourne-Again Shell Flashcards
Unix shell provides ___
an interface that lets the user interact with the operating system by running commands
To bash, there are three kinds of tokens:
- reserved words
- words
- operators
reserved words
words that have meaning to the shell and its programming language; e.g. if and while
operators
composed of one or more metacharacters
metacharacters
characters that have special meaning to the shell on their own, e.g. | and >
words
sequences of characters separated by metacharacters, which include simple separators like spaces and tabs, or characters that are special to the shell language, like semicolons and ampersands
word beginning with a dollar sign introduces ___
a variable or parameter reference
all variables are ___ by default
global
redirections allow the user to ___
control the input to and output from invoked commands
pipeline
a linear list of commands in which the output of one command in the list becomes the input of the next
Bash reads from ___ when interactive, and ___ specified as an argument otherwise
the terminal
the script file
Bash uses the ___ to implement command line editing.
readline library
Readline is structured as a ___.
read/dispatch/execute/redisplay loop
To update the terminal display, readline must track three things:
- the current contents of the buffer of characters displayed on the screen
- the updated contents of that display buffer
- the actual characters displayed
In the presence of multibyte characters, ___, and the redisplay engine must take that into account.
the characters displayed do not exactly match the buffer
Readline’s approach to the string-to-string correction problem is ___
- identify the beginning and end of the portion of the buffer that differs
- compute the cost of updating just that portion, including moving the cursor backward and forward
- perform the lowest-cost update
- clean up by removing any characters remaining at the end of the line if necessary and position the cursor in the correct spot
Most modifications to the redisplay engine have been to ___ and ___.
- have non-displaying characters in the prompt (such as to change colours)
- cope with characters that take up more than a single byte