Progress
Language Reference


UNIX Statement

Interfaces
OS
SpeedScript
All
UNIX only
Yes

Runs a program, UNIX command ,or UNIX script, or starts a UNIX interactive shell to allow interactive processing of UNIX commands.

SYNTAX

UNIX
  [SILENT]
  [ command-token | VALUE ( expression ) ] ... 

SILENT

After processing a UNIX statement, the Progress shell pauses and prompts you to press SPACEBAR to continue. You can use the SILENT option to eliminate this pause. Use this option only if you are sure that the UNIX program, command, or batch file does not generate any output to the screen.

command-token | VALUE ( expression )

One or more command (command-token) words and symbols that you want to pass the UNIX operating system to execute. The VALUE option generates the command tokens included in expression, a character string expression. The specified combination of command-token and VALUE ( expression ) options can form any legal combination of commands and command options permitted by UNIX, including programs, built-in commands, and scripts. If you do not use any of these options, the UNIX statement invokes the UNIX shell and remains there until you press CTRL-D or the EOF character set by the UNIX stty command.

EXAMPLES

On UNIX, procedure r-unix.p starts a shell and in it runs the UNIX “ls” command. On Windows, this procedure starts a command processor and in it runs the DOS “dir” command.

r-unix.p
IF OPSYS = "UNIX" THEN UNIX ls.
ELSE IF OPSYS = "WIN32" THEN DOS dir.
ELSE DISPLAY OPSYS "is an unsupported operating system". 

In r-unx.p, if you type an L, Progress runs the DOS dir command or the UNIX ls command. If you enter a procedure name that is stored in the proc variable, the RUN statement then runs the procedure.

r-unx.p
DEFINE VARIABLE proc AS CHARACTER FORMAT "x(40)".

REPEAT:
  DISPLAY "Enter L to list your files"
    WITH ROW 5 CENTERED FRAME a.
  SET proc LABEL "Enter a valid Procedure Name to run"
    WITH ROW 9 CENTERED FRAME b.
  IF proc = "L" THEN
    IF OPSYS = "UNIX" THEN UNIX ls.
    ELSE IF OPSYS = "WIN32" then DOS dir.
    ELSE display "Operating system" OPSYS "is not supported".

  ELSE DO:
    HIDE FRAME a.
    HIDE FRAME b.
    RUN VALUE(proc).
   END.
END. 

NOTES

SEE ALSO

DOS Statement, OPSYS Function, OS-COMMAND Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095