bash as subshell ignores ignoreeof ?

bash as subshell ignores ignoreeof ?

Post by Kurt Klingbe » Thu, 08 Sep 1994 03:42:54



I like to use ^D to "get lost", and set the env var "export ignoreeof=1".
Things work as expected in the login shell, but invoking bash
as a subshell either from the prompt, from inside any application,
or using su, that shell acts as if ignoreeof=10 even though it
really is 1.  If I unset ignoreeof altogether within a subshell,
the first ^D blows it away (not exactly fat-finger-proof ;-).

It seems to be Slackware 1.2 - Linux dependant since I've used bash on
HPUX and Sun systems without this problem.

any ideas ?

kk

 
 
 

bash as subshell ignores ignoreeof ?

Post by Chet Ram » Thu, 15 Sep 1994 23:58:43




>I like to use ^D to "get lost", and set the env var "export ignoreeof=1".
>Things work as expected in the login shell, but invoking bash
>as a subshell either from the prompt, from inside any application,
>or using su, that shell acts as if ignoreeof=10 even though it
>really is 1.  If I unset ignoreeof altogether within a subshell,
>the first ^D blows it away (not exactly fat-finger-proof ;-).

>It seems to be Slackware 1.2 - Linux dependant since I've used bash on
>HPUX and Sun systems without this problem.

>any ideas ?

If $BASH_VERSION says the version is anything older than 1.14, subshells
don't pick up `ignoreeof' from their parent.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer



 
 
 

bash as subshell ignores ignoreeof ?

Post by Mark P. Nels » Fri, 16 Sep 1994 01:36:20


: I like to use ^D to "get lost", and set the env var "export ignoreeof=1".
: Things work as expected in the login shell, but invoking bash
: as a subshell either from the prompt, from inside any application,
: or using su, that shell acts as if ignoreeof=10 even though it
: really is 1.  If I unset ignoreeof altogether within a subshell,
: the first ^D blows it away (not exactly fat-finger-proof ;-).

Check and see whether ignoreeof is set elsewhere.  It took me a couple
of days to weed out all the ignoreeof=10s and change them to
set +o ignoreeof.  there's /etc/profile, of course, and I'm afraid it
was so long ago I can't remember where else I had to do it--for every
computer on our net, too though!

: It seems to be Slackware 1.2 - Linux dependant since I've used bash on
: HPUX and Sun systems without this problem.

I got it from an old SLS.  I really think you'll find it's being set
somewhere, and has nothing to do with the version of Linux or Bash.

--

                         While I'll admit that anyone can make a mistake once,
                         to go on making the same lethal errors century after
                         century seems to me nothing short of deliberate.--V.

 
 
 

1. Bashing bash (Was Re: bash or user error with set -e and subshells)

Hi there,

This thread was initially about whether it is a bug or a feature, that
bash pedanticly sticks to the POSIX-sufficient requirement that 'set -e'
exit only after getting a nonzero status from a "simple command", while
the original Bourne makes a very useful generalization to "any child"
(including subshells).

I'm still interested in the answer: could some kind person please
address this issue specifically, without digressing to the (otherwise
exciting) millions of ways of avoiding a subshell, or good/bad reasons
to use 'set -e' ?...

What's the rationale after all ? The generalization is trivial to
implement, while the bash behavior has already consumed many
person-months in debugging (as witnessed by groups.google.com) !

Please...

TIA,

-Alex

2. Welcome to comp.unix.shell [Frequent posting]

3. BASH BASH BASH BASH BASH BASH BASH BASH BASH BASH

4. Required kernel that supports second IDE/second channel for CD-ROM

5. Exit errors by subshells are ignored in most shells

6. Troubles to accessing Linux via ethernet networking ---- need help!

7. `Nested (`Nested Subshells`) Subshells`

8. Looking for a machine

9. tcsh - to subshell or not to subshell

10. gnu midnight commander bash subshell not working (aix 4.2.1)

11. bash: Can a "function" be run without a subshell?

12. bash redirection stdout and stderr - pipeline command causes subshell execution

13. Pipes and subshells w/bash