Technically, REM is a regular DOS command just like the others -- it's not a 
"comment" like we're used to seeing in most coding languages.  If you type 
"REM" at a command line it doesn't give you a "Bad Command" error message 
because it is a legitimate command even though it doesn't really do anything.

The main time this matters is for redirection -- you can redirect the input or 
output of a REM command.  While redirecting the input is pretty pointless, 
redirecting the output can be a very useful thing to do.  You can create a file 
of zero length (the only space it takes on disk is in the FAT and does not 
actually occupy any sectors) by doing something like:

REM > NADA.BAT

This creates a batch file called NADA.BAT that doesn't do anything, but also 
doesn't use any disk space.  Just like the NUL device is handy (and at times 
even necessary), batch files that don't do anything are sometimes useful as 
well.


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to