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: Robert Elz
Subject: Re: [bash 4] 'test -v 1' is never true
Date: Mon, 28 Nov 2022 04:32:49 +0700

    Date:        Mon, 28 Nov 2022 02:53:40 +1000
    From:        Martin D Kealey <martin@kurahaupo.gen.nz>
    Message-ID:  
<CAN_U6MXYV6Ukq9DC7XFKSZm-XPEbTJM=N84bsBqXUxhc7DB6PQ@mail.gmail.com>

  | The expansion `$[var+replacement}` was part of the Bourne shell when I used
  | it in 1985 (before POSIX was first published),

>From the original Bourne sh (released outside Bell Labs in 1979)

  | whereas `test A -gt B` is rather newer,

No, same vintage.   All appeared in 7th edition - though test wasn't
built into the shell back then (still worked just the same, just a bit
slower).

  | and `test -v` is only a Bash extension (and similarly wasn't
  | added until later).

Yes.

There's also no need to use [[ ]] for this, good old test (or [ ])
works for everything described here, except -v, (and is portable).

kre




reply via email to

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