我在使用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 = " "; //