0% found this document useful (0 votes)
34 views

Windows Shell Script Programming For The Absolute Beginner - 6

Uploaded by

Ramil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Windows Shell Script Programming For The Absolute Beginner - 6

Uploaded by

Ramil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

xi

Creating an Exit Process ......................................................... 77

Contents
Generating Random Answers ................................................ 77
Displaying the Fortune Teller’s Prediction ............................ 78
Replaying the Game ............................................................... 79
The Final Result ....................................................................... 79
Summary ..................................................................................... 85

4
CHAPTER Storing and Retrieving
Information in Variables 87
Project Preview: The Story of Buzz the Wonder Dog ............... 88
Passing Data to Scripts at Execution Time ................................ 90
Handling Large Numbers of Arguments ............................... 92
Handling Arguments That Include Blank Spaces ................. 93
Working with Variables ............................................................... 93
Accessing Environment Variables ......................................... 94
Creating, Modifying, and Deleting Script Variables ............. 98
Back to “The Story of Buzz the Wonder Dog” ........................ 105
Designing the Game ............................................................. 105
Configuring the Windows Command Console ................... 105
Building the Welcome Screen ............................................. 106
Providing the Reader with Instructions ............................... 107
Collecting Key Story Elements from the Reader ................ 108
Using Variable Substitution to Write the Story .................. 109
The Final Result ..................................................................... 111
Summary ................................................................................... 122

5
CHAPTER Applying Conditional Logic 123
Project Preview: The Guess a Number Game ........................ 124
Applying Conditional Logic to Control Script Execution ....... 126
Working with the IF Statement ............................................ 126
Providing for an Alternative Course of Action ................... 129
Determining Whether a Variable Already Exists ................ 129

You might also like