We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

What Is a Shell?

The program on the right that reads your commands and runs them is a shell. Shells do a lot of things, but their main job is to interpret the commands you type and then execute them.

REPL

Shells are often called "REPLs", which stands for:

  1. Read the command you type
  2. Evaluate that command, usually by running other programs on your computer
  3. Print the output of the command
  4. Loop: Give you a new prompt so you can do it again

Assignment

The expr command evaluates a simple expression and prints the result. It's a tiny program, but it's a great way to watch the shell "read, eval, and print."

  1. expr 123456 + 7890
    

Submit the shell checks.

Tip

Sometimes people get confused about the difference between the "prompt" and the "output". Let's break it down, here's my latest shell session:

wagslane:~$ echo hello
hello
wagslane:~$

The prompt I was given was: wagslane:~$

It's just telling me that the shell is ready to accept a command.

So I typed the command: echo hello

Once I pressed Enter, the shell read my command, evaluated it, and printed the output: hello

Then, the shell printed a new prompt so I can run a different command: wagslane:~$