that's a specific question how do i implement '>'
for example "ls -l >out.txt"
my shell can execute commands like "ls -l" or any other command.
i don't think i need pipe() for |, it's probably implemented with files...

In other words, the shell opens the output file. Then it forks itself to create a child. The child closes its stdout descriptor, and calls dup() to replace that with the fd of the open file. Then it executes the ls program. The parent, meanwhile, closes the fd (since it doesn't need it) and waits for the child to finish running.