while get a line split it into an array wordexp if first word is "cd" chdir if conatins "=" putenv if |// Do not end up with 2 shells running pipe fork if kid close dup2 doCommand if parent close dup2 doCommand doCommand: fork if kid if there is a ">" or "<" open the file if bad error exit dup2 remove 2 args // cout << "I'm duped"; for each item in path cmd = item + "/" + argv[0] exec cout bad bad bad exit else waitpid