Sponsored Content
Top Forums Shell Programming and Scripting Shell Text Based Game, This Error Makes NO sense. Please help Post 302732241 by lemonoid on Saturday 17th of November 2012 02:06:39 AM
Old 11-17-2012
SOLVED

Quote:
Originally Posted by elixir_sinari
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?
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 [ICODE]case[/ICODE[, while/do and nested if statements!!
 

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 "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. 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
vc(1)							      General Commands Manual							     vc(1)

Name
       vc - version control program

Syntax
       vc [-a] [-t] [-cchar] [-s] [keyword=value... keyword=value]

Description
       The  command  copies lines from the standard input to the standard output under control of its arguments and control statements encountered
       in the standard input.  In the process of performing the copy operation, user declared keywords may be replaced by their string value  when
       they appear in plain text and/or control statements.

       The  copying  of  lines from the standard input to standard output is conditional.  It is based on tests (in control statements) of keyword
       values specified in control statements or as command arguments.

       A control statement is a single line beginning with a control character, except as modified by the -t keyletter (see below).   The  default
       control character is colon (:), except as modified by the -c keyletter (see below).  Input lines beginning with a backslash () followed by
       a control character are not control lines and are copied to the standard output with the backslash removed.  Lines beginning with  a  back-
       slash followed by a noncontrol character are copied in their entirety.

       A  keyword  is  composed of 9 or fewer alphanumerics; the first must be alphabetic.  A value is any ASCII string that can be created with A
       numeric value is an unsigned string of digits.  Keyword values should contain blanks or tabs.

       Replacement of keywords by values occurs whenever a keyword surrounded by control characters is encountered on a version control statement.
       The  -a keyletter (see below) forces replacement of keywords in all lines of text.  An uninterpreted control character may be included in a
       value by preceding it with .  If a literal  is desired, then it too must be preceded by .

Options
       Keyletter arguments:

       -a Replaces the keywords surrounded by control characters in all text lines.

       -cchar
	  Specifies a control character to be used in place of :.

       -s Suppresses all warning messages.

       -t Ignores all characters from the beginning of the line to the first tab character.  If one is found, all characters up to  and  including
	  the tab are discarded.

Version Control Statements:
       :dcl  keyword[, ..., keyword]
	    Used to declare keywords.  All keywords must be declared.

       :asg keyword=value
	    Used  to  assign  values to keywords.  An asg statement overrides the assignment for the corresponding keyword on the command line and
	    all previous asg's for that keyword.  Keywords declared, but not assigned values have null values.

       :if condition
	    .
	    .
	    .
       :end
	    Used to skip lines of the standard input. If the condition is true all lines between the if statement and the matching  end  statement
	    are  copied  to  the  standard  output.  If the condition is false, all intervening lines are discarded, including control statements.
	    Note that intervening if statements and matching end statements are recognized solely for the purpose of maintaining the proper if-end
	    matching.
	    The syntax of a condition is:

	     <cond>  ::= [ "not" ] <or>
	     <or>    ::= <and> | <and> "|" <or>
	     <and>   ::= <exp> | <exp> "&" <and>
	     <exp>   ::= "(" <or> ")" | <value> <op> <value>
	     <op>    ::= "=" | "!=" | "<" | ">"
	     <value> ::= <arbitrary ASCII string> | <numeric string>

	    The available operators and their meanings are:

	       =      equal
	       !=     not equal
	       &      and
	       |      or
	       >      greater than
	       <      less than
	       ( )    used for logical groupings
	       not    may only occur immediately after the if, and
		      when present, inverts the value of the
		      entire condition

	    The  >  and  < operate only on unsigned integer values.  For example, : 012 > 12 is false).  All other operators take strings as argu-
	    ments.  For example, fB: 012 != 12 is true).  The precedence of the operators (from highest to lowest) is:
	       = != > <      all of equal precedence
	       &
	       |
	    Parentheses can be used to alter the order of precedence.
	    Values must be separated from operators or parentheses by at least one blank or tab.

       ::text
	    Used for keyword replacement on lines that are copied to the standard output.  The two leading control  characters	are  removed,  and
	    keywords  surrounded  by  control  characters  in text are replaced by their value before the line is copied to the output file.  This
	    action is independent of the -a keyletter.

       :on

       :off
	    Turn on or off keyword replacement on all lines.

       :ctl char
	    Change the control character to char.

       :msg message
	    Prints the given message on the diagnostic output.

       :err message
	    Prints the given message followed by:
		 ERROR: err statement on line ... (915)
	    on the diagnostic output.  The command halts execution, and returns an exit code of 1.

Diagnostics
       Use for explanations.

Exit Codes
       0 - normal
       1 - any error

																	     vc(1)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy