title: using a new path with execve to run ls command
body: <p>I am trying to use execve to run the ls command. Currently I'm running it with the following arguments:</p>
  
  <pre><code>execve(args[0], args, env_args)
  //args looks like {"ls", "-l", "-a", NULL}
  //env_args looks like {"PATH=/bin", "USER=me", NULL}
  </code></pre>
  
  <p>What I expected this to do was run the ls command using my new env_args meaning that it would look up ls in my PATH.  However, this code actually doesn't do anything and when I run the code it just returns to my command prompt without output.</p>
  
  <p>Using the same args[] I was using execvp and ls worked and searched my current path.</p>
  
  <p>Can you tell me what I am doing wrong?</p>
  
  <p>What I am trying to do is write my own shell program where I can create and export my own environment and have exec use the environment I have defined in a char**.  Essentially I am writing my own functions to operate on env_args to add and remove vars and when I call exec i want to be able to call exec on {"ls", "-l", NULL} and have it look down my new environments path variable for a valid program called ls.  I hope this explains what I am doing a little better.  I don't think the extern environ var will work for me in this case.</p>