Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread Robert Elz
Date:Sat, 26 Nov 2022 10:09:22 +0700 From:Robert Elz Message-ID: <28751.1669432...@jacaranda.noi.kre.to> | This can be easier to read if written as 'test "$@" -ge 1' | which means the same. And of course, I meant $# there, not $@ (just a typo...) kre

Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread Greg Wooledge
On Sat, Nov 26, 2022 at 10:09:22AM +0700, Robert Elz wrote: > My preferred method for this, which works for all kinds > of variables and parameters is > > test "${X+s}" = s > > where X is whatever is to be tested (1 in this case) > and "s" is any string you like, except "" .. must be > the

Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread Robert Elz
Date:Fri, 25 Nov 2022 16:53:11 -0500 From:Greg Wooledge Message-ID: | So the question is whether "1" qualifies as a "shell variable". I would | argue that it doesn't -- it's a special parameter, not a variable (because | you can't assign to it). A positional

Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread Alejandro Colomar
Hi Branden! On 11/25/22 22:40, G. Branden Robinson wrote: Hi Alex, At 2022-11-25T22:02:46+0100, Alejandro Colomar wrote: I wrote a script, and am trying it on many systems. On RHEL8, which has bash 4, it didn't work. I could reduce the problem to the following command, which never returns

Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread Greg Wooledge
On Fri, Nov 25, 2022 at 03:40:42PM -0600, G. Branden Robinson wrote: > I don't think it is a bug. It is unspecified behavior according to > POSIX. > > "-v" is not an operator according to POSIX, and I don't recall seeing it > in any shell. It is therefore interpreted as a string argument.

Re: [bash 4] 'test -v 1' is never true

2022-11-25 Thread G. Branden Robinson
Hi Alex, At 2022-11-25T22:02:46+0100, Alejandro Colomar wrote: > I wrote a script, and am trying it on many systems. On RHEL8, which > has bash 4, it didn't work. I could reduce the problem to the > following command, which never returns true: > > test -v 1; > > In Debian Sid, where I

[bash 4] 'test -v 1' is never true

2022-11-25 Thread Alejandro Colomar
Hi! I wrote a script, and am trying it on many systems. On RHEL8, which has bash 4, it didn't work. I could reduce the problem to the following command, which never returns true: test -v 1; In Debian Sid, where I develop, and where I have bash 5, that works fine, and is true if the

Bash-5.2 official patch 12

2022-11-25 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-012 Bug-Reported-by:Kerin Millar Bug-Reference-ID: <20221002095107.89561bc811e549b55644d...@plushkava.net> Bug-Reference-URL:

Bash-5.2 official patch 10

2022-11-25 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-010 Bug-Reported-by:la...@apache.org Bug-Reference-ID: Bug-Reference-URL: https://savannah.gnu.org/support/?110744 Bug-Description: Bash-5.2

Bash-5.2 official patch 11

2022-11-25 Thread Chet Ramey
BASH PATCH REPORT = Bash-Release: 5.2 Patch-ID: bash52-011 Bug-Reported-by:Fabien Orjollet Bug-Reference-ID: Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023776

Re: bash 5.2 regression in optimize_connection_fork

2022-11-25 Thread Chet Ramey
On 11/24/22 2:12 PM, Frode Nordahl wrote: Just wanted to mention that the fix in https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel=94d25f57f124a9b2268a3af0a0915871032f426e does indeed solve the issue for me. Thank you for the proper fix and credits for the bug report. Credit where