I'm looking for a way to determine whether or not the function execvp succeeded or failed. I do know that if it returns then it has failed, but I'm looking for a case in which the command launched from execvp has failed. Such as in the case where "ls" is trying to list a non-existent folder. From this I plan to add support for logic operators (e.g. &&, ||). Thanks.
else {
int status;
if (wait(&status) < 0) {
perror("wait failed");
exit(0);
}
if (status == 0) {
success = true;
}
else {
success = false;
}
}