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