0

我想使用该execl函数从我的 c 程序中调用命令 cd 和 vi,但它不起作用。这就是我为 rm 和 ls 所做的:

execl("/bin/ls", "ls", NULL);
execl("/bin/rm", "rm", args[1], NULL); //args is the array containing the arguments of the command

它适用于lsand rm,但是当我尝试用viand做同样的事情时cd它不起作用。

4

0 回答 0