Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14126
| Path | csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail |
|---|---|
| From | Pierre Gaston <pierre.gaston@gmail.com> |
| Newsgroups | gnu.bash.bug |
| Subject | Re: Conditions with logical operators and nested groups execute "if" and "else" |
| Date | Tue, 22 May 2018 09:23:30 +0300 |
| Lines | 37 |
| Approved | bug-bash@gnu.org |
| Message-ID | <mailman.209.1526970235.1292.bug-bash@gnu.org> (permalink) |
| References | <CAM4RgKgOACdJtjBFpKMhfoXvbSwun=84pPdADNaJVKcd-Z5GFg@mail.gmail.com> |
| NNTP-Posting-Host | lists.gnu.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| X-Trace | usenet.stanford.edu 1526970235 15406 208.118.235.17 (22 May 2018 06:23:55 GMT) |
| X-Complaints-To | action@cs.stanford.edu |
| Cc | "bug-bash@gnu.org" <bug-bash@gnu.org>, bash@packages.debian.org |
| To | Uriel <url.15.104@gmail.com> |
| Envelope-to | bug-bash@gnu.org |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yLx/C0HdnXJTW/QVyTwAqKiCMbRRGP3Arrg63PeRK4s=; b=OkH25GGbip1JkhRQubgKHAYZ722O9uns2p70UDZpANZnT4GeI+jJ5G4JEIQ8QU28J8 sSlww8psBctvxfwFXygoN/F/rTw65MZKPBuv9GX9x8c9Ay0SRgiJgf6fTuuNDF8f2syL U9iOixKIvO8pGJnP01QA2K54SvvbJuiBsmINXlnXJ6lhwRjqKDuJuts9/xwE1/h6Xf3C k0vE00/Fn+NQ/KRVmfAA0udK0Mr2AP1+srdA8wwLWJMqpD7Z3im0ficdRrGMXUbJtZ1o 9sXydjKQXdew1W1iuaBAImodtTj36U4V1+rZ+nqSWGoiyPHWrmJmDiEhZqe2d/Hk68IU evBQ== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yLx/C0HdnXJTW/QVyTwAqKiCMbRRGP3Arrg63PeRK4s=; b=tKqif/1I+JTHuAjohHymCoXcZtWKhke9Pm7YnR/G8pk3qULUddeBJF2IPM6y5B8gUx S2RanXCpHbHS8o1V6vDfLmUE6wwjSHhVnnjn3/wTbBGpD44iWZfnAyjIK6OPNcm/XyO/ 7Asb4yhz7tV4uaabsf5BxeEhLwQsbuxD3GAJovOqA6neDmRbYwcl3dyp/zdVN2OqGYjZ C5gMnObbUojdmUGiUtlIAA75UWMZMZFsQEKE1P4JQ2okf+8RbeMIyGUQEHfWwekZelNm SAHCpBbUyW+EbPhNKsBa6d8aji1De1bkG2l/dHz/3nkvZcDWZ+otAvjBdwCqhZk1/IiA cxdA== |
| X-Gm-Message-State | ALKqPwfI8+o2Dwu+tuG2+NANm4MBHPvByGCEw1OA8H6XueMHcRS6KdK1 ntpncDYuozP4Nth+E99373Bz/atV194FirBHwY0= |
| X-Google-Smtp-Source | AB8JxZq56DQg+o0ENookuk4ZjyD/wr7JOd0t6iPfCSiKucImJ17o2b2l6Dl7nBU8ix+l9r1bzm8h/Qt8x+LrLCaoXEY= |
| X-Received | by 2002:ac8:2315:: with SMTP id a21-v6mr21630904qta.73.1526970231048; Mon, 21 May 2018 23:23:51 -0700 (PDT) |
| In-Reply-To | <CAM4RgKgOACdJtjBFpKMhfoXvbSwun=84pPdADNaJVKcd-Z5GFg@mail.gmail.com> |
| X-detected-operating-system | by eggs.gnu.org: Genre and OS details not recognized. |
| X-Received-From | 2607:f8b0:400d:c0d::22b |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.21 |
| X-BeenThere | bug-bash@gnu.org |
| X-Mailman-Version | 2.1.21 |
| 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 | <http://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> |
| Xref | csiph.com gnu.bash.bug:14126 |
Show key headers only | View raw
On Tue, May 22, 2018 at 12:17 AM, Uriel <url.15.104@gmail.com> wrote:
> Configuration Information:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
> -DSHELL
> -DHAVE_CONFIG_H -I. -I../. -I.././include -I.././lib -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -O2
> -fdebug-prefix-map=/build/bash-DWMIDv/bash-4.4.18=.
> -fstack-protector-strong -Wformat -Werror=format-security -Wall
> -Wno-parentheses -Wno-format-security
> uname output: Linux HPgS 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1
> (2018-05-07) x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Version: 4.4
> Patch Level: 19
> Release Status: release
>
> Description:
> As you know, a conditional is of the type:
> if [[ EXPRESSION ]]; then TRUE CONDITION; else ALTERNATIVE RESULT; fi
>
> Or with logical operators and groups:
>
> [[ EXPRESSION ]]; && { TRUE CONDITION; } || { ALTERNATIVE RESULT; }
>
> Within each of the conditionals there may be more nested, written the first
> or
> second way they should give the same result
>
Why? || means "or" not "else"
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Conditions with logical operators and nested groups execute "if" and "else" Pierre Gaston <pierre.gaston@gmail.com> - 2018-05-22 09:23 +0300
csiph-web