Im writing a shell in c right now and one the things I need to do is have it exit when ctrl+d is pressed. How would I do this? What does ctrl+d stand for? I have no idea where to look.
Any help would be much appreciated.
Im writing a shell in c right now and one the things I need to do is have it exit when ctrl+d is pressed. How would I do this? What does ctrl+d stand for? I have no idea where to look.
Any help would be much appreciated.
I assume you are working on a UNIX/like platform, in which case, CTRL+D is a signal called the "Hangup" passed to the process, when the user presses CTRL+D on this working process.
To trap this information, you can use the signal() function call, to install a handler for this signal.