Re: [9fans] test command - Plan9

This is a discussion on Re: [9fans] test command - Plan9 ; > > 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, > ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: [9fans] test command

  1. Re: [9fans] test command

    > > 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".


    there are certainly better ways to do this, but this works:

    - erik

    #!/bin/rc
    rfork e

    p='
    $1 == "mtime:" {
    gsub("[()]", "", $8)
    print $8
    }'

    for(i){
    syscall -s fstat 0 buf 1024<$i>[2=1] |
    awk $p
    }


  2. Re: [9fans] test command

    > there are certainly better ways to do this, but this works:

    as does /bin/mtime.


  3. Re: [9fans] test command

    Hello,

    On 2008/09/11, at 11:38, Russ Cox wrote:

    >> there are certainly better ways to do this, but this works:

    >
    > as does /bin/mtime.


    I didn't know this command.

    thanks russ and erik.

    Kenji Arisawa



+ Reply to Thread