Saturday 22 August 2009

Tip of the Day: Prevent Exiting a Shell with Ctrl+D

A normal Bash shell with exit the current session when pressing ^D (Ctrl+D), but this can be avoided by editing the ~/.bashrc file and adding the following line:

export IGNOREEOF=1

This command will set the $IGNOREEOF variable to true, preventing a single combination of ^D to exit. In order to close the session, you can still use exit or double ^D.

No comments: