company logo

Call procedure file (CALL)

The command runs commands from the file. Procedure files should not contain quit statements (q), since this will terminate the OShell program;

Parameters:

  • file_name - complete path to the file containing the instructions. When no file name is passed, the procedure must be defined in the current command file or has to be loaded explicitly ( LOAD )
  • entry_point - when an entry point is appended to the file name the procedure is not processed from the beginning but from the entry point, which must be a defined entry point in the procedure.
  • parameter - Any number of parameters may be passed to the procedure called. The receiving procedure may refer to parameters by %1 , %2 etc.

When calling a procedure file name with an entry point like

CALL myprocs.osh@start

the entry point name must precede the file name without space. The entry point must be defined in the file on a single line preceded by @, in this case @start . In order to return from the procedure, return has to be called. Otherwise, the procedure returns after last line in the command file.

Syntax:

  call [file_name][@entry_point] [parameter [parameter] ...]