tB then wait. - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 93fb47050c80d20d668035c7d1b89d610c1aa7d8
DIR parent b9b5cea4eda1c011cfc2e18c8b89987d4298cb7c
HTML Author: rsc <devnull@localhost>
Date: Sat, 11 Oct 2003 03:58:19 +0000
B then wait.
Diffstat:
A bin/Bwait | 17 +++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)
---
DIR diff --git a/bin/Bwait b/bin/Bwait
t@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# run B but then wait for the file to change.
+# great to set as $EDITOR.
+# the notion of a file changing is a little weak.
+
+stat=`ls -l $1`
+B "$@"
+while true
+do
+ nstat=`ls -l $1`
+ if [ "$stat" eq "$nstat" ]
+ then
+ exit
+ fi
+done
+