hi, im trying to read input from the user with fgets for example "ls" then use execvp to make the command happen but when i try it nothing happens. what am i missing?
Code:#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #define MAXSIZE 10 main() { char *inputString; inputString = malloc(MAXSIZE); char *const parmList[] = {"/bin/ls", NULL}; printf("Please enter a string: "); fgets(inputString, MAXSIZE, stdin); execvp(inputString, parmList); free(inputString); }