execve with path search?
问题 I want to execute a program from my code, and supply it with environment variables and arguments. AFAICT, execve is the right choice. But, execve receives a path argument, not a filename , meaning it expects the first argument to be a path to the executable. I know I can parse $PATH myself to find the path, but really, is there no other choice? Has no one else implemented it somewhere for me to use? 回答1: Some systems may provide execvpe() . A Google search for 'execvpe' shows a variety of