Shell Text Based Game, This Error Makes NO sense. Please help

Okay so I'm making a simple text based game that branches into different scenarios. By branching I mean branching off into whole different files with that part of the game in it. I got tired of working on scenario 1 so I'm working on scenario 2. As I get started and try to test it, I get an error that makes absolutely no sense. This code should work. Other than echo'ing text to progress the story line, all I had to do was copy and paste some of the exact same code into this scenario. I will post the terminal error I'm getting first and then post the code. Please tell me if you see an error.
ERRORS:
/bin/ap_test2: line 62: syntax error near unexpected token `fi'
/bin/ap_test2: line 62: `fi'

Note that I have marked line 62 in the code for the purpose of assistance. the numbers 62 are not really in the code

#!/bin/bash

echo "

Great, you get to figure out how to upgrade the main version of the  software on the older device. Once you're done with that, we will use a  software dump to figure out the differences in old and new. We will  incorporate the new features on the old and prove whether Apple is being  honest to the public about being able to upgrade their software!

"
    read return
echo "Cyna walks up to you and hands you a flash drive. 'On this is  everything that we have developed here in OTA to rip apart Apple  software, including an emulator which will run as soon as you boot up  the device on which you are working. The terminal has a debugging bridge  which pulls and records every single process that runs as soon as you  press the power button on the device. Now head over to your brand new  office, make yourself at home and get started with that mainver upgrade.
"
    read return
echo "You walk into the office, and it is amazing. There are plants  surrounding the office, and a ceiling that simulates the current  conditions of the sky outside the building. The whole right side of the  office is laden with a huge desk with multiple monitors, PC's, cables,  external HDD's, and various Raspberry Pi looking devices that are  probably used to simulate the current devices on which OTA is working.  Perpendicular to the right wall is a table on the left wall with fresh  cupcakes, donutes, eclairs, froyos, gingerbread androids, honeycombs, a  bowl of jelly beans, a key lime pie, and a mini-freezer with  android-shaped ice cream sandwiches. There is a refrigerator with fresh  made lemonade, orangeade, cans of Mountain Dew, and Peach Bellini Tea."


echo "You sit down in a chair that feels like a Tempurpedic as it molds  to your back and turn on the super PC in front of you. As you look at  it, there are eight buttons on the front, each for a different Operating  System, with 7 and 8 being automatically known to be repair terminal  and a Windows safe mode, you read a post-it note left by whomever was  here last that reads ***Backtrack seems to be the only distro that would  establish communication with the Ray*** ."
        read return
echo "Well I guess I should use Backtrack"
        read return
echo -n "
    Which OS would you like to use? (Enter a number)
    1 ) Ubuntu
    2 ) Gentoo
    3 ) Linux Mint
    4 ) Backtrack Linux
    5 ) Fedora
    6 ) Windows

"
read distro
    case distro in
    4 ) echo "You chose Backtrack Linux, now booting Backtrack Linux"
    ;;
    * ) echo "You chose $distro, now booting OS"
esac

echo "I guess I should boot up securely, as in disable wifi, boot up,  setup my username and password, write a boot script to disable wifi  unless I initiate it, and restart the computer and change all my  credentials."
        read return
"Now I've disabled wifi, time to boot up"

echo "The button is pressed and no sound is heard except a brief sucking  sound which is the aqua-cooling system setting its pressure. Blue  lights shine from the side out of an intricate hex-in-hex patterned  plexiglass. You see the drive deck at station 4 move backwards and then  lift up into a resting place. You can see the fans begin to work inside  and with a press of a button on top by the USB 7.0 Port, the speed of  the fans can be set. I will leave this alone for now. the wifi button is  still lit up brightly white."

echo "A setup screen pops up asking generic installation question, time  zone, partitions, etc. Then the User setup screen pops up...."
        read return

echo -n "Enter username > 
"
    read username
    echo -n "Enter a strong password >
"
    read -s userpass
    echo -n "Enter password again >
"
    read -s userpass1
        { 
         if [ $userpass != $userpass1 ]; then
     echo "Your passwords did not match. Please re-enter a new one."
     read -s userpass
     echo "Enter password again"
     read -s userpass1
     fi
        }
fi    *****LINE 62******
        read return
echo "Now that I've got that boot script written for the wifi, I'll  restart the computer and reset my username and login just in case  somehow the connection to this computer was compromised, or someone in  OTA (God I hope not) has alterior motives."
        read return

you frogot the ;; after the line

* ) echo "You chose $distro, now booting OS"

That should not be a problem at all. The last ;; in the case construct is optional.

@OP: To which if does the fi on line 62 correspond?

2 Likes

yeah its not the ;; in the case , it's not required at the end of the case statement (although it isn't a bad habit). it IS required for multiple case statements. And as far as the fi on line 62, I was just reviewing my code, and it was one of those things that I just kept looking over and I noticed. I got on here to post this as resolved. The fi was a mistake due to the copy and pasting from the other scenario of the game. I know copy/paste causes a lot of errors and I browsed it for misplaced quotation marks and various other errors, but I forgot that the whole statement that I copied was part of an if statement from the other scenario. That fi on line 62 should not have been there, there only should have been the one on line 60 but thank you so much for your prompt response to this. I've just began learning scripting and bash as a whole about 4 days ago, so I'm sure this is going to be a go-to source for help in this text based game. I'm just trying to find a way to spice it up and once I do I'm sure I'll have way more complicate code than case[/ICODE[, while/do and nested if statements!!