Bash

Overview

Today’s spooky worksheet will (hopefully) be a bit of a fun divergence. To get comfortable navigating around the terminal, we will be playing a video game, GameShell! Or rather the venerable ancestor to modern video games, the text based role playing game. You’ll be delving into the depths of castle cellars and slaying spiders like a proper Halloween adventure!

For this worksheet, please complete all the basic missions, #1 through #12. Feel free to adventure more though!

Get the Game

Fittingly for a terminal based game, you’ll actually download the game through the terminal! We need to do some prep work first though. You will need to do different things depending on your operating system.

macOS

Before you can install the game, you will first need to install the tools get get the dependancies (what the game needs to run). First, install homebrew using the following. It will take a few mins.

bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Once that is done, install the game dependencies (the things it needs to run) using:

brew install nano pstree tree man-db wget

Finally, get the game using:

wget https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh

You can then start the game as normal using:

bash gameshell.sh

Windows (Windows Subsystem for Linux)

To start off, open up a terminal and copy & paste the following command. It will ask you to enter your user password because it is installing new software for the game to run. You will not see your password as you enter it, this is normal.

sudo apt install gettext man-db procps psmisc nano tree bsdmainutils x11-apps wget

If you want to know what this command does:

  • sudo (super-user do) elevates this command to admin status so it can install new things, that’s why you need the password
  • apt install tells the terminal to install the following programs
  • The rest are programs, most of which you probably already have (gettext man-db procps psmisc nano tree bsdmainutils x11-apps wget)

Next up, you will use wget or web-get to download the game file off the internet. It will save the file wherever you currently are in the terminal, so probably best to move back to your user directory if you have moved elsewhere.

wget https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh

Playing the Game

Once both of those commands are finished running, you can enter the following to start the game:

bash gameshell.sh

Once you start the game, it will provide instructions on how to proceed. You will be using many of the commands we learned today. There are a few game specific commands that it will ask you to use. Know that these are just for the game, they won’t work anywhere else:

gsh goal
Check your current goal
gsh check
Check if you have completed your current goal
gsh help
Get help with game specific commands