[9fans] test command - Plan9

This is a discussion on [9fans] test command - Plan9 ; Hello, "test" command of plan 9 has a operator "older", the usage is: test f -older t where f is a file and t is a time. however the command does not have "newer" operator. why? Kenji Arisawa...

+ Reply to Thread
Results 1 to 7 of 7

Thread: [9fans] test command

  1. [9fans] test command

    Hello,

    "test" command of plan 9 has a operator "older", the usage is:
    test f -older t
    where f is a file and t is a time.
    however the command does not have "newer" operator.
    why?

    Kenji Arisawa



  2. Re: [9fans] test command

    On Wed, Sep 10, 2008 at 3:19 AM, Kenji Arisawa wrote:
    > Hello,
    >
    > "test" command of plan 9 has a operator "older", the usage is:
    > test f -older t
    > where f is a file and t is a time.
    > however the command does not have "newer" operator.
    > why?
    >


    If a < b, and you want to know if b > a, can't you just do a < b?

    ron


  3. Re: [9fans] test command


    a < b = !(a > b) + (a = b)

    > On Wed, Sep 10, 2008 at 3:19 AM, Kenji Arisawa
    > wrote:
    >> Hello,
    >>
    >> "test" command of plan 9 has a operator "older", the usage is:
    >> test f -older t
    >> where f is a file and t is a time.
    >> however the command does not have "newer" operator.
    >> why?
    >>

    >
    > If a < b, and you want to know if b > a, can't you just do a < b?
    >
    > ron
    >
    >



    --
    Rodolfo García AKA kix
    http://www.kix.es/
    EA4ERH (@IN80ER)



  4. Re: [9fans] test command

    On Wed, Sep 10, 2008 at 6:38 AM, ron minnich wrote:

    > On Wed, Sep 10, 2008 at 3:19 AM, Kenji Arisawa
    > wrote:
    > > Hello,
    > >
    > > "test" command of plan 9 has a operator "older", the usage is:
    > > test f -older t
    > > where f is a file and t is a time.
    > > however the command does not have "newer" operator.
    > > why?
    > >

    >
    > If a < b, and you want to know if b > a, can't you just do a < b?
    >
    > ron
    >
    >

    Yeah with < and ! you can build anything you want :-)

    Hence why many C++ STL comparisons just require you to make a functor for
    less.

    Dave


  5. Re: [9fans] test command

    Maybe I'm confused, but what Kenji said is that:

    > "test" command of plan 9 has a operator "older", the usage is:
    > test f -older t
    > where f is a file and t is a time.


    If f is a file ant t is a *time*, you can't do test t -older f

    Juan


  6. Re: [9fans] test command

    On Wed, Sep 10, 2008 at 5:27 PM, Juan Céspedes wrote:
    > Maybe I'm confused, but what Kenji said is that:
    >
    >> "test" command of plan 9 has a operator "older", the usage is:
    >> test f -older t
    >> where f is a file and t is a time.

    >
    > If f is a file ant t is a *time*, you can't do test t -older f
    >


    yes, but !older is the same as younger or equal.
    !(test f -older t)
    would be the same (equality notwithstanding)
    as
    test f -younger t

    But then there is = and != for strings (for example), so this argument
    is thin :-).
    --
    - curiosity sKilled the cat


  7. Re: [9fans] test command

    Hello,

    On 2008/09/11, at 1:15, Gorka Guardiola wrote:
    > yes, but !older is the same as younger or equal.


    yes.

    > But then there is = and != for strings (for example), so this argument
    > is thin :-).


    if we can easily get modified time of a file in the format of UNIX time,
    where "easily" means "in the set of plan 9 commands".

    Kenji Arisawa



+ Reply to Thread