This commit is contained in:
Ben Harris 2016-11-14 18:07:56 -05:00
parent 3e6baa5f7e
commit 5bb0428c15
2 changed files with 5 additions and 4 deletions

View File

@ -77,13 +77,14 @@ int main(int argc, char **argv){
}
}
// int i;
// int n;
// bish_expandexec(&cmd->cmds[0]);
int in = 0, fd[2];
for (int i = 0; i < num_cmds-1; i++) {
pipe(fd);
dup_io(in, fd[1], true);
dup_io(in, fd[1]);
bish_expandexec(&cmd->cmds[i]);
close(fd[1]);
// close(fd[1]);
in = fd[0];
}
if (in != 0) {

View File

@ -133,7 +133,7 @@ int expand_and_execute (const char *program, char **options) {
}
}
pid = fork ();
pid = fork();
if (pid == 0) {
/* This is the child process. Execute the command. */
execvp (result.we_wordv[0], result.we_wordv);