Re: Ctrl-D exits unexpectedly

2013-05-12 Thread Chet Ramey
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, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/



cd won't change the prompt if the command is typed in the vi editor (vi mode).

2013-05-12 Thread Peng Yu
Hi,

I have vi mode set.

set -o vi.

Then I type v to enter the vi editor. In the vi editor, I type 'cd
/tmp'. Then, I get the following screen output. Notice that the prompt
does not change immediately after the cd command. Could anybody
reproduce this behavior? Thanks.

~$
cd /tmp
~$ echo $PWD
/tmp
/tmp$

-- 
Regards,
Peng