About the Command Line Syntax

The syntax used for the command line is a subset of that used by the Microsoft Windows Command line (cmd.exe) or the Borne Shell (sh).

The OS Command adapter supports all substitutions in file parameters anywhere on the command line or in a script (pointed to file substitutions). For example:

rundir3/myprog.exe "{workid}" > {root xx}myfile.out

You must use the following standards when entering the command:

  • Separate arguments with spaces.

  • Enclose arguments that contain spaces or special characters in single or double quotation marks.

  • Use < to supply standard input to the program from a file. Follow the < with the name of the file, or insert a file parameter. You can leave a space between the < and the file name.

  • Use > to direct standard output of the program to a file. If standard output is not redirected, it is lost.

  • Use 2> to redirect the standard error stream to a file. By default, standard error is sent to the job log.

  • Use 2>&1 to redirect standard error to the same file as standard output. This setting is useful only if standard output is also redirected into a file.

Note: does not support other shell or cmd.exe punctuation such as “|” (pipe), “&&” or “;” (multiple commands), and “&” (background).

For example, to run the program myprog with arguments a and b c d, reading input from the file sample.txt and writing output to the file bar.txt, the command line would resemble the following:

myprog a "b c d" <sample.txt >bar.txt

On Windows operating systems, it is sometimes necessary to enclose an argument in double quotation marks when passing it to the operating system, even if the argument does not contain spaces. To support this, any argument on the command line that is surrounded by double quotation marks is passed to the operating system with the double quotation marks, regardless of whether or not the argument contains spaces. Arguments surrounded by single quotation marks are sent to the operating system with double quotation marks only if the argument contains spaces.

On Linux systems, all quotation marks are removed because Linux accepts arguments as separate strings instead of as a single command line.