E
Excluded_Middle
Hi,
My teacher gave me an assignment to create a shell using ANSI C and
system calls. The shell is going to be very simple that can handle IO
redirection and pipes.
so far I create a program that prompts user and read commands using
scanf and then save this command in a string called cmd. then it uses
fork to create a child process and then execute the command using
execlp,my teacher said use execvp but it was giving me error. i.e when
I use
execvp(cmd,(char *)0) /* cmd is char cmd[200] */
it gives me error.
can any one explain why.
My teacher gave me an assignment to create a shell using ANSI C and
system calls. The shell is going to be very simple that can handle IO
redirection and pipes.
so far I create a program that prompts user and read commands using
scanf and then save this command in a string called cmd. then it uses
fork to create a child process and then execute the command using
execlp,my teacher said use execvp but it was giving me error. i.e when
I use
execvp(cmd,(char *)0) /* cmd is char cmd[200] */
it gives me error.
can any one explain why.