SpartaDOS X Reference Manual

The Command Processor — Advanced Features




The Command Processor — Advanced Features

Index


I/O Redirection   You may redirect the standard input and output of SpartaDOS X commands on the command line. With SpartaDOS 3.2, redirection was done using batch files (for input redirection) and the PRINT command (for output redirection). SpartaDOS X implements I/O redirection in a totally different manner. Batch files are no longer considered as "input redirection" — they are only read by the command processor and are not system wide (i.e. you may not feed input to BASIC through a batch file). The PRINT command has been eliminated.

With SpartaDOS X, you may divert output of a single command by including ">>d:fname" on the command line. Similarly, input redirection is accomplished by including a "<<d:fname" on the command line. For example, the command

    DIR >>PRN:

redirects the output from the DIR command to the printer (the directory listing will not appear on the screen). An alternate way to copy a file would be

    TYPE fname >>dest

This will be slower than the copy command and will not copy the date to the new file.

    BASIC <<AUTOGO

will run the BASIC program "START.BAS" if the text file "AUTOGO" contains the line

    RUN "D:START.BAS"

As an example of output redirection, the following batch file will allow paged viewing of the output of any program by redirecting it to a temporary file, then TYPEing the temporary file with the pause option:

    %1 %2 %3 %4 %5 %6 %7 %8 %9 >>TEMP
    TYPE TEMP /P
    PAUSE
    DEL TEMP

For example, if you named the above batch file MORE.BAT and wanted to read the directions printed by the ARC program, use

    -MORE ARC


Previous page

Next page