[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

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-26 Thread Alejandro Colomar
Hi Chet! On 11/26/22 18:44, Chet Ramey wrote: On 11/25/22 4:02 PM, Alejandro Colomar wrote: 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

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

2022-11-27 Thread Alejandro Colomar
Hi Alexey, On 11/27/22 12:41, Alexey wrote: On 2022-11-26 21:45, Alejandro Colomar wrote: That was my gut; thanks!  I'll workaround with $#. I could suggest you to use for clarity another construction: [[ ${1+isset} ]] || echo "not set" Here "isset" is just for readabil

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

2022-11-27 Thread Alejandro Colomar
On 11/27/22 14:10, David wrote: On Mon, 28 Nov 2022 at 00:01, Alejandro Colomar wrote: On 11/27/22 12:41, Alexey wrote: On 2022-11-26 21:45, Alejandro Colomar wrote: I could suggest you to use for clarity another construction: [[ ${1+isset} ]] || echo "not set" Here "