Gotcha (programming) - Gotchas in DOS Batch File Language

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:

    Every generation rewrites the past. In easy times history is more or less of an ornamental art, but in times of danger we are driven to the written record by a pressing need to find answers to the riddles of today.... In times of change and danger when there is a quicksand of fear under men’s reasoning, a sense of continuity with generations gone before can stretch like a lifeline across the scary present and get us past that idiot delusion of the exceptional Now that blocks good thinking.
    —John Dos Passos (1896–1970)

    And so it goes, back and forth, good church-members all, which means that their banter contains nothing off-color, and by the same token, nothing that was coined later than the first batch of buffalo nickels.
    Robert Benchley (1889–1945)

    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 (1817–1862)

    All official institutions of language are repeating machines: school, sports, advertising, popular songs, news, all continually repeat the same structure, the same meaning, often the same words: the stereotype is a political fact, the major figure of ideology.
    Roland Barthes (1915–1980)