/* * Rick van der Zwet * 0433373 * OS Assigment 4 - Part B * Licence: BSD * $Id: parse-arguments.c 540 2008-04-01 20:51:39Z rick $ */ /* Input required libaries */ #include #include #include /* First executed function, called by default, with arguments the * arguments and number of arguments ;-) */ int main (int argc, char * argv[]) { printf("Process[%d]: parse-arguments in execution ... \n", getpid()); /* the child's process new program */ /* This program replaces the parent's program */ int i; printf("Number of arguments %i\n", argc); /* Loop trough all arguments */ for (i = 0; i < argc; i++) { printf("Command line argument %i: %s\n", i, argv[i]); } printf("Process[%d]: parse-arguments, terminating .. \n", getpid()); return(0); }