bug-bash
[Top][All Lists]
Advanced

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

Re: Perhaps more than CDPATH is risky


From: Chet Ramey
Subject: Re: Perhaps more than CDPATH is risky
Date: Fri, 15 Aug 2008 17:26:38 -0400
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

geoff@cs.hmc.edu wrote:

        I think somebody needs to audit bash to ask the following questions:

        (1) If environment variable X is imported to a script, what
            are the bad effects?

        (2) What is the probability that a script writer will remember
            to reset X?  (Heck, how many scripts even reset IFS?  And
            that's been well known about sh for 20 years.)

        (3) If X is disabled in non-interactive mode, what are the bad
            results?

        (4) Is it sufficient to null out X on startup, and then let
            the script reset it if it chooses?

The man page and info doc should list all of the shell variables that
affect bash's behavior.  If that's not the case, please report it.

As for IFS, the shell does reset it to " \t\n" at startup (which I
cribbed from the Korn shell).  That's why bash scripts don't reset
it themselves.

If by (4) you mean that the shell should ignore variables from the
environment when it starts up in non-interactive mode, there will have
to be a very good case made to introduce this level of backwards
incompatibility.  That case hasn't been made yet.

(And the CDPATH issue has come up before.  Several times.)

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

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




reply via email to

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