#include "stringarray.h"
/* Other header files here */


#define MAX_PATHS 50
char * searchpaths[MAX_PATHS];
/* as in the previous assignment */

void mysystem(char * command)
{
   char * commandcopy;

   /* strtok alters the string it operates on, do make a copy */
   commandcopy = (char *)malloc (strlen(command)+1);
   strcpy(commandcopy, command);

   /* Tokenize commandcopy and save the tokens into an array of strings */






   ret = fork();
   if(ret == 0)  /* Child code */
   {
      /* Scan through the search paths */
      for(i = 0; searchpaths[i] != NULL; i++)
      {
	    /* Build the full path command */



	    /* Try to execute the command with execv */



	    /* Clean up the memory. Execution reaches here if execv fails */
      }
   } 
   else  /* Parent code */
   {
     wait(NULL);
     printf("Done\n");
   }
}

int main()
{
   /* extend code from the previous assignment to invoke mysystem on input commands other than quit, path and where */
}