Re: Logical expression works does not work as expected

2024-12-31 Thread Chet Ramey
On 12/28/24 3:23 PM, Lawrence Velázquez wrote: On Fri, Dec 27, 2024, at 6:47 PM, Greg Wooledge wrote: You might have been raised on some other language where the && and || operators have different precedence. In the shell language, they have the same precedence. However, the && and || arithme

Re: Logical expression works does not work as expected

2024-12-28 Thread Greg Wooledge
On Sat, Dec 28, 2024 at 15:23:41 -0500, Lawrence Velázquez wrote: > On Fri, Dec 27, 2024, at 6:47 PM, Greg Wooledge wrote: > > You might have been raised on some other language where the && and || > > operators have different precedence. In the shell language, they have > > the same precedence. >

Re: Logical expression works does not work as expected

2024-12-28 Thread Lawrence Velázquez
On Fri, Dec 27, 2024, at 6:47 PM, Greg Wooledge wrote: > You might have been raised on some other language where the && and || > operators have different precedence. In the shell language, they have > the same precedence. However, the && and || arithmetic operators do have C-like precedence.

Re: Logical expression works does not work as expected

2024-12-28 Thread Chet Ramey
On 12/27/24 4:52 PM, Павел Fortovey wrote: I apologize. I found out that this behavior is not a bug. I didn't think that bash is such a strange scripting language with its own interpretation of the concept of logic. AND-OR lists are left-associative and || and && have equal priorit

Re: Logical expression works does not work as expected

2024-12-27 Thread Greg Wooledge
On Sat, Dec 28, 2024 at 00:52:59 +0300, Павел Fortovey wrote: >I apologize. I found out that this behavior is not a bug. > >I didn't think that bash is such a strange scripting language with its >own interpretation of the concept of logic. >Repeat-By: > >bash -c "true

Logical expression works does not work as expected

2024-12-27 Thread Павел Fortovey
Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux pve-lab 6.8.12-5-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-5 (2024-12-03T10:26Z) x86_64 GNU/Linux Machine Type: x86_64-

Re: Logical expression works does not work as expected

2024-12-27 Thread Павел Fortovey
I apologize. I found out that this behavior is not a bug. I didn't think that bash is such a strange scripting language with its own interpretation of the concept of logic. 21:54, 27 декабря 2024 г., "Павел Fortovey" : Machine: x86_64 OS: linux-gnu Compiler: gcc Compil