[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: x[
From: |
Greg Wooledge |
Subject: |
Re: x[ |
Date: |
Mon, 29 Jul 2019 13:14:12 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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.
- x[, Isabella Bosia, 2019/07/29
- Re: x[, Clint Hepner, 2019/07/29
- Re: x[, Eli Schwartz, 2019/07/29
- Re: x[,
Greg Wooledge <=
- Re: x[, Martijn Dekker, 2019/07/29
- Re: x[, Eli Schwartz, 2019/07/29
- Re: x[, Koichi Murase, 2019/07/29
Message not available
- Re: x[, Stephane Chazelas, 2019/07/29
Re: x[, Chet Ramey, 2019/07/29