ok, just for background info, i'm attempting to write my own shell. Here's my problem though.
Two problems: 1) my program doesn't exit when you type in 'x'. Secondly, when i do the fork, pid1 never equals 0, therefore my execlp never runs... for instance, I can type "ls" into my prompt and it just returns nothing and prints out my prompt again. HELP?Code:while(scanf("%s", &inputstr) !='x'){ pid1=fork(); if (pid == 0) execlp(inputstr); else wait(&statloc); printf("[%s %s]$ ", linebuf, pwd);