Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting Shell Text Based Game, This Error Makes NO sense. Please help Post 302732221 by lemonoid on Saturday 17th of November 2012 01:09:22 AM
Old 11-17-2012
Bug 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.
/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


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"

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    *****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

Test Your Knowledge in Computers #58
Difficulty: Medium
Douglas Engelbart invented the computer mouse.
True or False?

9 More Discussions You Might Find Interesting

1. Linux Benchmarks

Linux Benchmarks Makes No Sense

I created two computers with identical hardware, and run the benchmark programs in both starting at the same exact time. What makes no sense is that the computer that has the lower average index (121) finished the race a good 30 minutes ahead of the computer wich showed the higher avg index... (0 Replies)
Discussion started by: philip_38
0 Replies

2. UNIX for Dummies Questions & Answers

Simple grep - Not sure it makes sense!

I have 3 files in directory mydir named as follows, I run the sequence of commands shown below and I have questions at the result. File names are: ABC_GP0 ABC_GP0.ctl ABC_GPX Commands and results: $ ls /mydir/ | grep * <-- (q1) I get nothing - OK $ ls /mydir/ | grep... (5 Replies)
Discussion started by: GNMIKE
5 Replies

3. Shell Programming and Scripting

BASH: How do I grep on a variable? (or simmilar question that makes sense)

Hi, I've been running code which very frequently calls books.csv. e.g: grep -i horror books.csv > tempExcept, I'm trying to move away from using temporary files or frequently calling books.csv to improve efficiency. So I tried something like bookfile=$(cat books.csv) grep -i horror... (4 Replies)
Discussion started by: Quan
4 Replies

4. Shell Programming and Scripting

diff result makes no sense

Hi, I have written a small shellscript Imagine dbalt.txt already existed... " .... touch report.txt lynx -dump "" > site1.txt lynx -dump "" > site2.txt grep -E 'Nummer: |EUR' site1.txt > preis1.txt grep -E 'Nummer: |EUR' site2.txt >... (2 Replies)
Discussion started by: Blackbox
2 Replies

5. UNIX for Dummies Questions & Answers

text based football game?

Is there a textbased football game (American) that I can download through ubuntu server edition? (1 Reply)
Discussion started by: dadoprso
1 Replies

6. Shell Programming and Scripting

Making a Text based game. Need help.

Okay so Zork sparked my interest in this. I have been learning to program for the last year and a half. I've dabbled in everything from Java to Ruby to PHP & XHTML & SQL, and now I'm on bash. I really like bash scripting. Its easy and fun. I just started two days ago. Pretty much I've been writing... (1 Reply)
Discussion started by: lemonoid
1 Replies

7. Programming

This Makes NO sense. I'm making a game and getting an error, need 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... (1 Reply)
Discussion started by: lemonoid
1 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Making a text based game

Hello, I am looking to make a text based game, that runs in the command window, or a window similar. I will only need to use 1 window. I read somewhere that there is libraries for this kind of thing? But I can't remember the name of them.. Can anyone point me in a direction? I will be... (2 Replies)
Discussion started by: murphy
2 Replies

9. Shell Programming and Scripting

Creating a text based game using shell script.

Hello guys I'm new to shell scripting and I need to make a game using shell script. I want to know if it is possible for me a total noob to shell scripting to make this game. The game concept is simple: First thing when you launch the script you get a menu in which you select if you want to... (3 Replies)
Discussion started by: Othmane
3 Replies

Featured Tech Videos

All times are GMT -4. The time now is 05:04 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy