[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch #10070] toggle invert flag when reading `!'
From: |
Dale R. Worley |
Subject: |
Re: [patch #10070] toggle invert flag when reading `!' |
Date: |
Wed, 26 May 2021 21:55:47 -0400 |
>> > [[ ! 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 results as "foo".
> I will try this as:
>
> $ [ 1 -eq 1 ]; echo $?
> 0
> $ ! [ 1 -eq 1 ]; echo $?
> 1
> $ ! ! [ 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.
Pipelines
A pipeline is a sequence of one or more commands separated by one of
the control operators | or |&. The format for a pipeline is:
[time [-p]] [ ! ] command [ [|||&] command2 ... ]
Dale
- Re: [patch #10070] toggle invert flag when reading `!', Chet Ramey, 2021/05/24
- Re: [patch #10070] toggle invert flag when reading `!', felix, 2021/05/26
- Re: [patch #10070] toggle invert flag when reading `!',
Dale R. Worley <=
- Re: [patch #10070] toggle invert flag when reading `!', Chet Ramey, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Andreas Schwab, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Chet Ramey, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Andreas Schwab, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Chet Ramey, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Andreas Schwab, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Alex fxmbsw7 Ratchev, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Greg Wooledge, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Alex fxmbsw7 Ratchev, 2021/05/27
- Re: [patch #10070] toggle invert flag when reading `!', Andreas Schwab, 2021/05/27