Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16587

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

From Robert Elz <kre@munnari.OZ.AU>
Newsgroups gnu.bash.bug
Subject Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode
Date 2020-07-20 15:28 +0700
Message-ID <mailman.187.1595233746.24492.bug-bash@gnu.org> (permalink)
References <5f066ef0-1fed-ad5b-d564-490268d32427@case.edu> <CAH7i3LqG=mnoiSbetxVdg3wqso5orGgMqQk70-UfJ=wcdf6uLQ@mail.gmail.com> <8ddc4816-f85e-97b3-5c51-9b55acdcaca5@case.edu> <CAH7i3LpXfj3p5tXS_4S_dxdvdLG_tNyBa-4bU=z0Xih1=Tr7OA@mail.gmail.com> <26757.1595233713@jinx.noi.kre.to>

Show all headers | View raw


    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

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Assignment-like word shouldn't be subjected to tilde expansion in POSIX mode Robert Elz <kre@munnari.OZ.AU> - 2020-07-20 15:28 +0700

csiph-web