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


Groups > gnu.bash.bug > #15263

Re: x[

Path csiph.com!goblin3!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: x[
Date Mon, 29 Jul 2019 13:14:12 -0400
Lines 27
Approved bug-bash@gnu.org
Message-ID <mailman.167.1564420473.1985.bug-bash@gnu.org> (permalink)
References <CAAZkfoK2hYq_qSkdKYc1on=+V4VEBgpgZW96sYNZwC+AMw7iTw@mail.gmail.com> <9EA25AF1-6D80-456A-81FA-6D908072E624@gmail.com> <a6a2b6a8-6151-78dc-41be-fc81250a40e5@archlinux.org> <20190729171412.GD1218@eeg.ccf.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1564420473 21507 209.51.188.17 (29 Jul 2019 17:14:33 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
Mail-Followup-To bug-bash@gnu.org
Content-Disposition inline
In-Reply-To <a6a2b6a8-6151-78dc-41be-fc81250a40e5@archlinux.org>
User-Agent Mutt/1.10.1 (2018-07-13)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 139.137.100.1
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 <20190729171412.GD1218@eeg.ccf.org>
X-Mailman-Original-References <CAAZkfoK2hYq_qSkdKYc1on=+V4VEBgpgZW96sYNZwC+AMw7iTw@mail.gmail.com> <9EA25AF1-6D80-456A-81FA-6D908072E624@gmail.com> <a6a2b6a8-6151-78dc-41be-fc81250a40e5@archlinux.org>
Xref csiph.com gnu.bash.bug:15263

Show key headers only | View raw


On Mon, Jul 29, 2019 at 01:09:28PM -0400, Eli Schwartz wrote:
> On 7/29/19 1:01 PM, Clint Hepner wrote:
> > The ``[`` begins a valid shell pattern, so the parser continues to
> > accept input until the closing ``]`` is found. Pathname expansion
> > (apparently) does not apply to the first "argument" of the
> > ``function`` command.
> 
> The initial workaround discovered, was to use
> 
> $ function _[ () { echo hello; }; <() _[
> hello
> 
> The use of <() somehow suppresses the glitch in the same way that
> quoting it does. If it were just glob expansion, then why should that be so?

Or even simpler:

wooledg:~$ echo x[
x[
wooledg:~$ x[
> 

The glitch doesn't occur when the x[ is an argument of a simple command.
It only occurs when x[ is being parsed *as* the command.  So, while I
suspect "looking for a glob" is part of the answer, it's not the whole
picture.

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


Thread

Re: x[ Greg Wooledge <wooledg@eeg.ccf.org> - 2019-07-29 13:14 -0400

csiph-web