PreviousNextIndex

UNIX statement


(UNIX only)

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
command-token | VALUE ( expression )
Examples

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

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, the AVM 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 NO-UNDO 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


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex