TPWW Forums  

Go Back   TPWW Forums > o t h e r > computer help forum

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 01-19-2013, 02:14 PM   #1
drave
 
drave's Avatar
 
Posts: 25,461
drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)drave makes a lot of good posts (200,000+)
Basic shell scripting

I am currently in a couple programming classes and have zero experience in programming, but pretty good elsewhere. We are given a step by step example from the book and I have actually copied and pasted the code. The issue I am coming across is when I force an error to try to get the appropriate error response, I get "is was unexpected at this time". The actual program will work all except giving the appropriate error msg.

@ECHO off


TITLE "KnockKnock1.bat - Tried and true, but still funny!"



COLOR 0E

CLS


ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.


SET /p reply="Knock Knock! C:>"

CLS


IF NOT %reply% == "Who is there?" (

ECHO "Sorry, you need to use quotes around your reply please."

GOTO :EOF )


ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

SET /p reply="Orange! C:>"



CLS



IF NOT %reply% == "Orange who?" (

ECHO "Sorry, you need to use quotes around your reply please."

GOTO :EOF )


ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.



ECHO "Orange you glad you've written your first Windows shells script?"



ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.

ECHO.
drave is offline  
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 06:33 PM.


Powered by vBulletin®