Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的代码是:
execvp(command, args);
参数是char* args[]
char* args[]
命令是char* command
char* command
例如 for ls -l, command 是 ls 而 args 是 -l 但是为什么在执行之后
ls -l
execvp(command, args)我得到的唯一结果ls不是ls -l??
execvp(command, args)
ls
参数列表还包含程序的名称。确保您的args数组同时包含"ls"和"-l"。
args
"ls"
"-l"