bug-bash
[Top][All Lists]
Advanced

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

Re: Bug in [ -d ... ] ?


From: Robert Elz
Subject: Re: Bug in [ -d ... ] ?
Date: Sat, 04 Nov 2017 00:24:01 +0700

    Date:        Fri, 3 Nov 2017 08:21:41 -0400
    From:        Greg Wooledge <address@hidden>
    Message-ID:  <address@hidden>

  | I am not seeing any evidence of this.

As I said, for that particular usage, the effect is the same, either way.
The way the shell gets there differs, but the result happens not to.

To see some difference, run

        for i in ${x-"a ${x-"b c"}" d}; do echo "z${i}z"; done

If you get (when x is unset of course)

        za bz
        zcz
        zdz

then the shell is doing it the (current) posix way.   Bash (and several
other shells) produce (because the 'b c' is being treated as quoted, when
it should not be with current posix rules - until the change is published
and it becomes unspecified.)

        za b cz
        zdz

and it is all because of the "what gets quoted, and where" issue (in many
examples, the "assign and then expand" behaviour often masks the differences,
so the '=' operator isn't the best way to see it.)

kre




reply via email to

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