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

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
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 Mon, 20 Jul 2020 15:28:33 +0700
Lines 25
Approved bug-bash@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1595233747 17364 209.51.188.17 (20 Jul 2020 08:29:07 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To chet.ramey@case.edu
Envelope-to bug-bash@gnu.org
In-Reply-To <5f066ef0-1fed-ad5b-d564-490268d32427@case.edu>
Received-SPF permerror client-ip=2001:3c8:9009:181::2; envelope-from=kre@munnari.OZ.AU; helo=munnari.OZ.AU
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -8
X-Spam_score -0.9
X-Spam_bar /
X-Spam_report (-0.9 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=1, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01 autolearn=no autolearn_force=no
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <26757.1595233713@jinx.noi.kre.to>
X-Mailman-Original-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>
Xref csiph.com gnu.bash.bug:16587

Show key headers only | 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