diff --git a/result.txt b/result.txt deleted file mode 100755 index e69de29..0000000 diff --git a/yeeshell b/yeeshell index 5eea9ac..07643ed 100755 Binary files a/yeeshell and b/yeeshell differ diff --git a/yeeshell.c b/yeeshell.c index 1123ea9..7570c56 100644 --- a/yeeshell.c +++ b/yeeshell.c @@ -204,13 +204,13 @@ int execute(char *cmdline, char **args) { fd = open(redirect_filename, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IXUSR); close(1); - dup2(1, fd); + dup(fd); } else if (redirect_flag == 2) { fd = open(redirect_filename, O_RDONLY, S_IRUSR); close(0); - dup2(0, fd); + dup(fd); } /* The child process inherits the parent's signal mask and will inherit it after exec,