The name of a program to execute, as a string.
The arguments to the program, each as a string.
This function is a binding for the C function execvp, which causes the interpreter to terminate immediately, and to run the named program in its place. The "p" in the execvp function indicates that a search is made for the named executable in the current path, as defined by the PATH shell variable. Unlike the C execvp function, the first argument in Gamma's exec function does not repeat the program name--it is automatically inserted for you.
Gamma> exec("/bin/ls","-l","/usr/bin");
-rwxr-xr-x 1 root root 98844 Aug 7 2000 a2p*
-rwxr-xr-x 1 root root 4080 Jul 19 2000 access*
-rwxr-xr-x 1 root root 10256 Jul 12 2000 aclocal*
...
(does not return)
See the Starting Programs section of the Common Functions chapter (Tutorial One), or the Start a Process section of the Common Functions for Any Program (Tutorial Two) chapter in the Cogent Tools Demo and Tutorials book for examples of this function used in context.