Gotchas in DOS Batch File Language
One would expect that the batch file would execute commands exactly as if they were typed manually. This is not true in the particular case when one of the commands is determined to be another batch file, in which case it simply replaces the one currently being executed.
C:\test>copy con main.bat @echo off echo Starting main.bat subr echo Completing main.bat ^Z 1 file(s) copied. C:\test>copy con subr.bat @echo off echo Starting subr.bat echo Completing subr.bat ^Z 1 file(s) copied. C:\test>main.bat Starting main.bat Starting subr.bat Completing subr.bat C:\test>Read more about this topic: Gotcha (programming)
Famous quotes containing the words dos, batch, file and/or language:
“In certain savage tribes in New Guinea, they put the old people up in the trees and shake them once a year in the spring; if they dont fall out they let them live another year.”
—John Dos Passos (18961970)
“Do you not know that a little yeast leavens the whole batch of dough?”
—Bible: New Testament, 1 Corinthians 5:6.
“A common and natural result of an undue respect for law is, that you may see a file of soldiers, colonel, captain, corporal, privates, powder-monkeys, and all, marching in admirable order over hill and dale to the wars, against their wills, ay, against their common sense and consciences, which makes it very steep marching indeed, and produces a palpitation of the heart.”
—Henry David Thoreau (18171862)
“An art whose medium is language will always show a high degree of critical creativeness, for speech is itself a critique of life: it names, it characterizes, it passes judgment, in that it creates.”
—Thomas Mann (18751955)