So im working on this project which is create a shell in C using fork() and execve() commands in POSIX.
The main things is a read_command() functions and a main which just has a while loop with fork and execve with an if statement that takes out the waitpid() command if the user types <command> & which means they want to run it in the background.
Now what i am trying to do is make it so instead of having to type a command such as /bin/ls or /usr/bin/xeyes to be able to jsut type "ls" or "xeyes" and so on. Is there anyways that i can get the system environment paths?
or can someone gimme a hint as to how to go about this problem?
Note: i am not asking for you to do it nor am i asking for u to give me the code