C implementation of a shell