summaryrefslogtreecommitdiff
path: root/APLDemo
diff options
context:
space:
mode:
Diffstat (limited to 'APLDemo')
-rwxr-xr-xAPLDemo19
1 files changed, 19 insertions, 0 deletions
diff --git a/APLDemo b/APLDemo
new file mode 100755
index 0000000..fbf85b5
--- /dev/null
+++ b/APLDemo
@@ -0,0 +1,19 @@
+#!/bin/rc
+
+winid=`{grep -e '-apl' /mnt/acme/index | awk '{print $1}' }
+if(~ $#winid 0){
+ win apl &
+ exit
+}
+
+state=/tmp/apldemo.$winid.state
+if (test -e $state)
+ current=`{cat $state}
+if not
+ current=1
+
+next=`{echo $current + 1 | hoc}
+echo $next > $state
+
+cat $1 | awk 'NR=='$current > /mnt/acme/$winid/body
+