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

Variables

  • If you're using Ubuntu on WSL, you're probably running a Bash shell.
  • If you're using macOS, you're probably running a Zsh shell.
  • If you're running full Linux, I pray you already know what you're using.

The point is that you're probably using Bash or Zsh, and for the purposes of this course, they're basically the same.

Both Bash and Zsh are shells, and they also happen to be powerful programming languages. They have variables, functions, loops, and more. That said, only crazy people write large programs in shell languages... shells are optimized for running other programs and writing small scripts, not for writing large applications.

Create a Variable

name="Lane"

Notice there are no spaces between the variable name, assignment operator = and value "Lane".

Use a Variable

Starting a line with the $ symbol is a convention to show it's a shell prompt, and it should not be typed. The actual command is echo $name.

$ echo $name
Lane

Unlike in Python, where you can just use a variable's name, in your shell you need to prefix the variable name with a $ to use it, else it would just print name instead of the value.

Interpolate a Variable in a String

$ echo Hello $name
Hello Lane

It's really just that easy.

Assignment

For the rest of this course, you'll be a forensic developer hired by the fictional "WorldBanc" to investigate a security breach. Like most mega-corporations, they don't know what they're doing, but they're happy to overpay you to come in so that they can say a "third-party expert" has reviewed their systems.

Turns out, you're not an expert, but you're happy to learn on someone else's dime, so why not jump at the opportunity? Right?...

...Anyhow, you'll be using your terminal and shell to traverse files, manipulate text, run programs, and investigate suspicious activity.

  1. bankname="WorldBanc"
    founded="1969"
    ceo="Jeff Gates"
    
  2. WorldBanc was founded in 1969 by Jeff Gates
    

Paste the entire command that generated the correct output into the text field and submit it.

Tip

Certain Windows versions may not let you paste into the Command Line. See how to enable ctrl+shift+v.