[Top][All Lists]

[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>

  | 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

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


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


reply via email to

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