9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] test command
@ 2008-09-10 10:19 Kenji Arisawa
  2008-09-10 13:38 ` ron minnich
  0 siblings, 1 reply; 10+ messages in thread
From: Kenji Arisawa @ 2008-09-10 10:19 UTC (permalink / raw)
  To: Fans Bell Labs of the OS Plan 9 from

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




^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [9fans] test command
@ 2008-09-11  0:36 erik quanstrom
  2008-09-11  2:38 ` Russ Cox
  0 siblings, 1 reply; 10+ messages in thread
From: erik quanstrom @ 2008-09-11  0:36 UTC (permalink / raw)
  To: arisawa, 9fans

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



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-09-11 13:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10 10:19 [9fans] test command 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
2008-09-11  0:36 erik quanstrom
2008-09-11  2:38 ` Russ Cox
2008-09-11 13:51   ` Kenji Arisawa

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