Op 24-05-21 om 17:47 schreef Chet Ramey:
On 5/22/21 2:45 PM, Vincent Menegaux wrote:
Previously, these commands:
[[ ! 1 -eq 1 ]]; echo $?
[[ ! ! 1 -eq 1 ]]; echo $?
would both result in `1', since parsing `!' set CMD_INVERT_RETURN
instead of toggling it.
Interestingly, ksh93 produces
On Mai 27 2021, Chet Ramey wrote:
> You can argue that it's not clear enough that it allows multiple `!'
> operators,
Not from my reading of the description. It largely follows the POSIX
gammar by only putting a single [!] into the pipeline syntax.
Andreas.
--
Andreas Schwab,
On 5/27/21 11:43 AM, Andreas Schwab wrote:
True, but bash accepts it.
The manual doesn't document that extension, though.
The bash manual documents the bash implementation. You can argue that it's
not clear enough that it allows multiple `!' operators, but it does not say
that it uses the
On Mai 27 2021, Alex fxmbsw7 Ratchev wrote:
> why doesnt it accept ! after |
Because either side of | cannot be a pipeline.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
On Mai 27 2021, Alex fxmbsw7 Ratchev wrote:
> thought it would be useful, especially with PIPESTATUS
You can always use a brace group.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely
thought it would be useful, especially with PIPESTATUS
On Thu, May 27, 2021, 17:49 Greg Wooledge wrote:
> On Thu, May 27, 2021 at 05:46:41PM +0200, Alex fxmbsw7 Ratchev wrote:
> > why doesnt it accept ! after |
>
> Because ! negates a pipeline, not a simple command inside a pipeline.
>
>
On Thu, May 27, 2021 at 05:46:41PM +0200, Alex fxmbsw7 Ratchev wrote:
> why doesnt it accept ! after |
Because ! negates a pipeline, not a simple command inside a pipeline.
why doesnt it accept ! after |
On Thu, May 27, 2021, 17:38 Chet Ramey wrote:
> On 5/27/21 11:20 AM, Andreas Schwab wrote:
> > On Mai 27 2021, Chet Ramey wrote:
> >
> >> On 5/26/21 9:55 PM, Dale R. Worley wrote:
> >>
> $ ! ! [ 1 -eq 1 ]; echo $?
> 0
> >>> That last one isn't
On Mai 27 2021, Chet Ramey wrote:
> On 5/27/21 11:20 AM, Andreas Schwab wrote:
>> On Mai 27 2021, Chet Ramey wrote:
>>
>>> On 5/26/21 9:55 PM, Dale R. Worley wrote:
>>>
> $ ! ! [ 1 -eq 1 ]; echo $?
> 0
That last one isn't defined by the manual page. I'm surprised you don't
On 5/27/21 11:20 AM, Andreas Schwab wrote:
On Mai 27 2021, Chet Ramey wrote:
On 5/26/21 9:55 PM, Dale R. Worley wrote:
$ ! ! [ 1 -eq 1 ]; echo $?
0
That last one isn't defined by the manual page. I'm surprised you don't
get a syntax error.
It's clearly valid.
According to the
On Mai 27 2021, Chet Ramey wrote:
> On 5/26/21 9:55 PM, Dale R. Worley wrote:
>
>>>$ ! ! [ 1 -eq 1 ]; echo $?
>>>0
>> That last one isn't defined by the manual page. I'm surprised you don't
>> get a syntax error.
>
> It's clearly valid.
According to the POSIX grammar, a pipeline can
On 5/26/21 9:55 PM, Dale R. Worley wrote:
$ ! ! [ 1 -eq 1 ]; echo $?
0
That last one isn't defined by the manual page. I'm surprised you don't
get a syntax error.
It's clearly valid.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita
>> >[[ ! 1 -eq 1 ]]; echo $?
>> >[[ ! ! 1 -eq 1 ]]; echo $?
>> >
>> > would both result in `1', since parsing `!' set CMD_INVERT_RETURN
>> > instead of toggling it.
Definitely, the section of the man page for "[[" says that "!" is a
negation operator, so "! ! foo" must yield the same
On Mon, May 24, 2021 at 11:47:32AM -0400, Chet Ramey wrote:
> On 5/22/21 2:45 PM, Vincent Menegaux wrote:
>
> > Details:
> >
> > Previously, these commands:
> >
> >[[ ! 1 -eq 1 ]]; echo $?
> >[[ ! ! 1 -eq 1 ]]; echo $?
> >
> > would both result in `1', since parsing `!' set
On 5/22/21 2:45 PM, Vincent Menegaux wrote:
Details:
Previously, these commands:
[[ ! 1 -eq 1 ]]; echo $?
[[ ! ! 1 -eq 1 ]]; echo $?
would both result in `1', since parsing `!' set CMD_INVERT_RETURN
instead of toggling it.
Interestingly, ksh93 produces the same result as bash. I
15 matches
Mail list logo