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:

    When you’re outa luck in this man’s country, you certainly are outa luck.
    —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)

    I have been a soreheaded occupant of a file drawer labeled “Science Fiction” ... and I would like out, particularly since so many serious critics regularly mistake the drawer for a urinal.
    Kurt Vonnegut, Jr. (b. 1922)

    Now that Stevenson is dead I can think of but one English- speaking author who is really keeping his self-respect and sticking for perfection. Of course I refer to that mighty master of language and keen student of human actions and motives, Henry James.
    Willa Cather (1873–1947)