Browse Source

Plan 9 from Bell Labs 2011-04-26

David du Colombier 13 years ago
parent
commit
631c842161
2 changed files with 19 additions and 0 deletions
  1. 16 0
      rc/bin/E
  2. 3 0
      sys/man/1/mtime

+ 16 - 0
rc/bin/E

@@ -0,0 +1,16 @@
+#!/bin/rc
+# E file - B file, wait until it changes, exit
+rfork e
+if (! ~ $#* 1) {
+	echo usage: $0 file >[1=2]
+	exit usage
+}
+if (! test -e $1) {
+	echo $0: $1: no such file >[1=2]
+	exit no-file
+}
+otm = `{mtime $1 | awk '{print $1}'}
+B $1
+while (~ $otm `{mtime $1 | awk '{print $1}'})
+	sleep 1
+exit ''

+ 3 - 0
sys/man/1/mtime

@@ -11,3 +11,6 @@ of each
 .IR file .
 .SH SOURCE
 .B /sys/src/cmd/mtime.c
+.SH SEE ALSO
+.IR du (1),
+.IR seconds (1)