read-eval-print loop
The cycle an interactive shell repeats: read a line, expand and run it, print the result, then show the prompt again.
In more detail
Every line you type goes through the same steps, and a script goes through them too, only reading from a file with no prompt in between. Knowing that the shell rewrites the line before running it explains most surprises with quotes and variables.
Related terms
- shell — The program that reads the commands you type, runs them and shows the results; sh and bash are common ones.
- shell prompt — The short text, often ending in a dollar sign, that the shell prints to show it is ready for your next command.
- shell expansion — The rewriting bash does to a command line before running it, replacing variables, patterns and other special forms with their values.
Taught in
- What A Shell Is, And What Bash Is — Bash Scripting & Command Line Automation
- What Bash Does To A Line Before It Runs It — Bash Scripting & Command Line Automation