我在使用execve時遇到了一些問題。我試圖創建一個可以像bash shell一樣運行的shell,但是我在執行命令的分叉子程序時遇到問題。這是我給孩子的。 cmd是一個char *與用戶鍵入的命令。然而,當我運行這個程序,我從PERROR得到這個錯誤: execve error: No such file or directory.
我試圖程序用一個簡單的LS,應該使path =「/ bin
[...] Preprocesser directives
void read_command()
{
int i; //index to the arrays stored in parameter[]
char *cp; //points to the command[]
const char *hash = " "; //