bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash doesn't send SIGHUP to children


From: Chet Ramey
Subject: Re: bash doesn't send SIGHUP to children
Date: Sat, 13 Sep 2008 22:15:14 -0400
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

Emil wrote:

Bash runs interactive.

Not the one you traced; see below.

After some further investigation it turned out that you also need to use
a function in your bash scripts to reproduce the bug.

I have the following in my .bashrc
mc () { MC=`/usr/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC; }

This changes things significantly.  The bash you traced is the one that
is waiting for the `mc' in the command substitution to exit and reading
its output -- that shell is not interactive.  The difference is probably
somewhere in the execution environment set up for command substitution.

To make sure, try the following function and see if you get the same
result:

mc()
{
        T=${TMPDIR:-/tmp}/mc-$$
        /usr/bin/mc -p "$@" > $T
        es=$?
        read MC < $T
        rm -f "$T"
        [ -n "$MC" ] && cd "$MC"
        unset MC
        return $es
}

It is probably the different mechanisms for handling terminating signals
in non-interactive shells.  I might have a fix, but I have to be able to
reproduce it, and I won't be back in front of a Linux machine to try until
next week.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]