bug-bash
[Top][All Lists]
Advanced

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

Re: Assignment-like word shouldn't be subjected to tilde expansion in PO


From: Robert Elz
Subject: Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode
Date: Mon, 20 Jul 2020 15:28:33 +0700

    Date:        Sun, 19 Jul 2020 15:21:07 -0400
    From:        Chet Ramey <chet.ramey@case.edu>
    Message-ID:  <5f066ef0-1fed-ad5b-d564-490268d32427@case.edu>

  | Maybe, but Posix says this isn't a variable assignment context, as POSIX
  | defines variable assignments, and technically  the shell shouldn't perform
  | tilde expansions after `=' or `:' at all. You could argue that bash has a
  | bug here in that it expands the tilde after the `='.

It may also be that this is a bug in POSIX, as all ksh shells seem to
act the way that bash does, expanding the first ~ but not the secpod.
Most other shells expand neither, except the NetBSD shell which treats
this as a var assignment (which it is really, however explained away in
POSIX) and expands both.

It is likely that if someone were to file a posix bug report about this,
it would turn into "unspecified" whether ~ expansion is done in that context.

kre




reply via email to

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