Jelena Mamčenko Operating Systems Lecture Notes on Operating Systems 39 When that subcommand is encountered, all parameter/marker pairings are shifted one to the left. Whatever was assigned to %0 is lost, the contents of %1 are moved to %0, %2 moves to %1 . .. %9 moves to %8 and a new parameter from the command line is moved into %9. While this brings in a new parameter, all have shifted and you must anticipate the effect on your batch file "program." The effect of SHIFT: Remember, this command seems very simple, but its effects are far ranging and the logical consequence of mismatching parameters and markers and be disastrous! FOR. .IN. .DO This command is similar to the programmer's FOR. .NEXT loop in that a particular action can be repeated a given number of times. The syntax (which may look a bit complicated) is: FOR %%Variable IN (Set) DO Command %%Variable is one-letter with the mandatory %% before it. Two percentage signs are used so this variable won't be confused with a marker. (Set) is one or more filenames or commands you want %%Variable to assume while the
This is the end of the preview. Sign up
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.