home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / os2 / misc / 40900 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  2.0 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!bcc.ac.uk!link-1.ts.bcc.ac.uk!ucgadkw
  2. From: ucgadkw@ucl.ac.uk (Dominik Wujastyk)
  3. Newsgroups: comp.os.os2.misc
  4. Subject: CMD.EXE special character interpretation (^&, etc.)
  5. Keywords: Mattes CMD.EXE command line
  6. Message-ID: <1993Jan02.124400.9233@bas-a.bcc.ac.uk>
  7. Date: 2 Jan 93 12:44:00 GMT
  8. Organization: Bloomsbury Computing Consortium
  9. Lines: 57
  10.  
  11. Some time back, I was having trouble constructing OS/2 
  12. command-line strings which had "&" in them.  I searched
  13. the online refs, manuals, and found no help.  Finally,
  14. Eberhard Mattes kindly sent me the following message, 
  15. which might be of more general interest.
  16.  
  17. [Timothy -  since this stuff isn't in any of the distributed
  18. documentation, perhaps it could go in the FAQ?]
  19.  
  20. -------------------------------------------------------------------
  21. Date: Sun, 6 Sep 92 17:33:03 +0200
  22. To: ucgadkw@uk.ac.ucl
  23. Subject: emTeX under OS/2 - help?
  24.  
  25. [...]
  26.  
  27. Information about ^ and & and ( and ) and all the other special
  28. characters in the command line is neither in the manual nor in the
  29. online documentation.
  30.  
  31. I try to give a summary:
  32.  
  33.  &              unconditional sequential execution of programs
  34.  &&             conditional sequential execution (`AND')
  35.  |              pipe
  36.  ||             conditional sequential execution (`OR')
  37.  >file          redirection of handle 1 to file
  38.  >>file         redirection of handle 1 to file (appending)
  39.  >&m            redirection of handle 1 to handle m
  40.  n>file         redirection of handle n to file
  41.  n>>file        redirection of handle n to file (appending)
  42.  n>&m           redirection of handle n to handle m
  43.  <file          redirection of file to handle 0
  44.  n<file         redirection of file to handle n
  45.  ( command )    grouping
  46.  ^              escape special character
  47.  
  48. (n=0...9, m=0...9)
  49.  
  50. Examples:
  51.  
  52. (make 2>&1) > make.out
  53.  
  54.   Run make and write both stdout and stderr to make.out.
  55.  
  56. prog1 && (prog2 || prog3)
  57.  
  58.   If prog1 succeeds, run prog2 (and prog3, if prog2 fails)
  59.  
  60. echo ^^^>
  61.  
  62.   Display ^>
  63.  
  64. [...]
  65. -------------------------------------------------------------------
  66.  
  67. Dominik
  68.