program stops after execvp( command.argv[0], command.argv)
I am writing a small shell program that takes a command and executes it. If the user enters a not valid command the if statement returns a -1. If the command is correct it executes the command, however once it executes the command the program ends. What am I doing wrong that is does not execute the lines of code after it? I have tested execvp( command.argv[0], command.argv) with ls and cat commands so I am pretty sure it works. Here is my code. int shell(char *cmd_str ){ int commandLength=0; cmd_t command; commandLength=make_cmd(cmd_str, command); cout<< commandLength<<endl; cout << command