Visit Our UNIX and Linux User Community


This Makes NO sense. I'm making a game and getting an error, need help.


 
Thread Tools Search this Thread
Top Forums Programming This Makes NO sense. I'm making a game and getting an error, need help.
# 1  
Old 11-17-2012
Code 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 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

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

# 2  
Old 11-17-2012
This is a duplicate of another thread created by this author in a different forum. See Shell Text Based Game, This Error Makes NO sense. Please help
An answer has already been posted on that thread.

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Beadm create -p on another pool - making sense of it

Hi all, I am trying out Solaris 11.3 Realize the option of -p when using beadm that i can actually create another boot environment on another pool. root@Unicorn6:~# beadm create -p mypool solaris-1 root@Unicorn6:~# beadm list -a BE/Dataset/Snapshot Flags... (1 Reply)
Discussion started by: javanoob
1 Replies

2. Shell Programming and Scripting

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... (3 Replies)
Discussion started by: lemonoid
3 Replies

3. UNIX for Dummies Questions & Answers

Why does fibonacci sequence script stop making sense at 92nd iteration?

So, Just for practice, I wrote a simple fibonacci sequence script in bash. (03:08:02\$ cat fib #!/usr/bin/bash ret () { echo -ne "\n" sleep .5 } a=1 b=2 echo -n $a #1 A ret echo -n $b #2 B ret (8 Replies)
Discussion started by: DeCoTwc
8 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 "http://site.com/index.htm" > site1.txt lynx -dump "http://site.com/index2.htm" > 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. 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

6. 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

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

8. Solaris

Making sense of df -k & format verify output

I'm posting the output from two disks on my Solaris machine. The first part is the output from using the format command and then using the verify option on each disk. The last part is the output from my df -k command. I'm trying to match the partition to the filesystem/mount point. I'm assuming... (13 Replies)
Discussion started by: gonzotonka
13 Replies

9. UNIX for Advanced & Expert Users

Process calls - making sense of truss results

Can someone point me at resources for system calls? Specifically, I am trying to make sense of what I am seeing in a truss command. Thanks! (3 Replies)
Discussion started by: jpeery
3 Replies

Featured Tech Videos