[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ctrl-D exits unexpectedly
From: |
Chet Ramey |
Subject: |
Re: Ctrl-D exits unexpectedly |
Date: |
Sun, 12 May 2013 17:48:56 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
On 5/10/13 1:12 PM, Martin Szummer wrote:
> Bash Version: 4.2
> Patch Level: 45
> Release Status: release
>
> Description:
> The IGNOREEOF behavior changed in Bash 4.2 (in Ubuntu 13.04) compared to
> bash in Ubuntu 12.10.
>
> I used to have in my .bashrc
> set -o ignoreeof
> export IGNOREEOF=10
> and in this case, Ctrl-D would never exit the shell, even if pressed more
> than 10 times.
>
> In the newer Bash 4.2 (patch 45), it *does* exit the shell after 10 Ctrl-D.
> The bug is that set -o ignoreeof does not have an effect.
> Even after unsetting IGNOREEOF, the shell exits. The set -o ignoreeof by
> itself does not make the shell ignore EOF; the only way seems to be to set
> IGNOREEOF to a very large number.
I'm not sure what version of bash you used on Ubuntu 12.10, but I tested
versions of bash back to bash-3.0, and they all behave as the documentation
states:
ignoreeof
The effect is as if the shell command
``IGNOREEOF=10'' had been executed (see Shell
Variables above).
Whether you execute the two commands above (which are more or less
equivalent) from the command line or in a startup file, the effect is the
same: the shell exits after you type ^D eleven times.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/