9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: arisawa@ar.aichi-u.ac.jp, 9fans@9fans.net
Subject: Re: [9fans] test command
Date: Wed, 10 Sep 2008 20:36:00 -0400	[thread overview]
Message-ID: <e74ba1e8829e54026aee8790360529ac@quanstro.net> (raw)

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



             reply	other threads:[~2008-09-11  0:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11  0:36 erik quanstrom [this message]
2008-09-11  2:38 ` Russ Cox
2008-09-11 13:51   ` Kenji Arisawa
  -- strict thread matches above, loose matches on Subject: below --
2008-09-10 10:19 Kenji Arisawa
2008-09-10 13:38 ` ron minnich
2008-09-10 14:16   ` Rodolfo kix García 
2008-09-10 15:21   ` David Leimbach
2008-09-10 15:27     ` Juan Céspedes
2008-09-10 16:15       ` Gorka Guardiola
2008-09-11  0:23         ` Kenji Arisawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e74ba1e8829e54026aee8790360529ac@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=arisawa@ar.aichi-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).