previous | start | next

eval

A function is provided to parse the command line string, cmdline:

int parseline(const char *cmdline, char **argv);
        
     

This function returns true (1) if the command line had a trailing & indicating the program is to be run as a background process and false (0), otherwise.

You need to declare an array of C strings to be passed to parseline and filled in by parseline. E.g.:

        char *args[MAXARGS];
     

This function adds an extra entry with the value NULL!

Just right for passing as execvp's second argument.



previous | start | next