Simulated a shell in C