How do i use dup (or dup2) to achieve redirection, in other words to execute commands like sort < in.txt > out.txt
. *System calls that create a new shell like (bin/sh/) are not allowed.
Asked
Active
Viewed 100 times
0

Marc B
- 356,200
- 43
- 426
- 500
-
1you're trying to WRITE a c shell, or use a C shell? – Marc B Apr 20 '15 at 21:43
-
possible duplicate of [redirecting I/O, implementation of a shell in C](http://stackoverflow.com/questions/19846272/redirecting-i-o-implementation-of-a-shell-in-c) – that other guy Apr 20 '15 at 21:53
-
@MarcB i'm trying to write a c shell... – Spilios Kakkas Apr 21 '15 at 08:03