One of my assignments in to write my own UNIX Shell. To receive input from the user, I am using fgets to capture the input as a string but I\'m not really sure how it works.
fgets is capturing the line break, too.
Note that you can overcome this in a few ways, one might be using strncmp:
if((strncmp(command, "exit", 4)) == 0)
which checks if only the first 4 characters of command match (though this might not be the right option for you here).
Another tactic is to check with the line break in place:
if((strcmp(command, "exit\n")) == 0)