bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Chet Ramey
Subject: Re: [bash 4] 'test -v 1' is never true
Date: Sat, 26 Nov 2022 12:44:04 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

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;

This is a bash feature. I cribbed it from ksh93, and it first appeared in
bash-4.2.

The initial implementation was restricted to shell variables -- positional
parameters like $1 are not shell variables.

After a bunch of requests, like

https://lists.gnu.org/archive/html/bug-bash/2018-12/msg00098.html
https://lists.gnu.org/archive/html/bug-bash/2018-12/msg00104.html
https://lists.gnu.org/archive/html/bug-bash/2020-01/msg00027.html

I added support for testing positional parameters in bash-5.1.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]