-
Notifications
You must be signed in to change notification settings - Fork 2
_exec
#exec
###Execute a exec shell command.
Syntax
status = exec command ;
Arguments
- str command
The command to execute.
Return Value
list status
- $ACKNOWLEDGE : The command was executed.
The STATUS variable is set to $ACKNOWLEDGE
list status
- $ACKNOWLEDGE : The command was executed.
The STATUS variable is set to $ACKNOWLEDGE
Exceptions
-
%ARGUMENT: Invalid arguments. Usage: status = exec command ;
-
%IO: Command string to long.
Description
In both UNIX and VMS systems, the system() function calls the system() 'C' run-time library function. Unless you require a result back from the command, it is preferable to use the system() function. The exec() command, on the other hand, is much more complex in the UNIX environment. In the VMS environment, system() and exec() and equivalent. In UNIX, the exec() command results in a fork'ed process with stdout redirected to with the resulting internal command:
execl ( "/bin/sh", "sh", "-c", command, (char *) 0 ) ;
Also, the exec() function in the UNIX environment returns the last line of stdout. If there is not output, the return value is 0.
Examples
puts "Create an example for the function 'exec'" ;
Related Links
None