Command Line

 


Use keywords to find the content you
are looking for with in the site.

Redirecting Command Input and Output

WinOne® allows Standard Input and Standard Output to be redirected on the command line and assumes that Standard Input comes from the keyboard and that Standard Output goes to the screen. The default Standard Input and Standard Output can be redirected using the following characters on the command line :-

  • The less than sign ( ie. ' < ' ) to use the contents of a file as the input for a command. For example :-
    SORT < filename

  • The greater than sign ( ie. ' > ' ) to send the output from a command to a file. When the specified file does not exist, it is created and when the file does exist, it is over written, and the previous contents are lost. For example :-
    SORT > filename

  • The double greater than sign (ie. ' >> ' ) appends the output from a command to the end of a file. . For example :-
    SORT >> filename

  • The bar character ( ie. ' | ' ) allows the Standard Output from one command to be used as the Standard Input to another command. This is referred to as a pipe. For example :-
    TYPE filename | SORT | MORE

    The commands TYPE, SORT and MORE are executed in that order, that is from left to right.

    Note:

    • When using redirection with text mode type programs, the executed task can not be placed in the background. For more information on placing a program in the background see Command Execution and Precedence.
  • Copyright © 1995-2018 Lucien Cinc, All Rights Reserved
    WinOne® is an Australian registered trademark

    Go to the Australian Command Line Software web site.