Operating_systems-page35

Operating_systems-page35 - Jelena Mamenko Operating Systems...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Jelena Mamčenko Operating Systems Lecture Notes on Operating Systems 35 The parameters may be used in any place in the batch file where a parameter would normally be used as part of the DOS command being run. Markers are used within the batch file to signify which parameter goes where. Markers are comprised of a percent sign (%) and a single digit between 0 and 9 (that's ten markers in use at any one time; remember, zero is a number). As an example: Assume that a batch file named REPEAT.BAT is on the current drive. This file contains two commands: "ECHO OFF" which stops DOS from showing commands and "ECHO %1 %3" where the ECHO command can show messages on the screen. If, at the DOS prompt you typed "REPEAT Red Blue Green" your screen would show "Red Green" as shown in the screen capture: In this simple example, three parameters were passed to the batch file and were placed into the ECHO command in the order received. Only the first and third are shown as only those were referenced in the batch file. The parameters and markers were related as follows.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/29/2011 for the course CSE 362 taught by Professor Mavin during the Spring '09 term at SUNY Stony Brook.

Ask a homework question - tutors are online