summaryrefslogtreecommitdiff
path: root/APLDemo
diff options
context:
space:
mode:
authorglenda <glenda@cirno>2022-09-13 13:20:23 +0000
committerglenda <glenda@cirno>2022-09-13 13:20:23 +0000
commit9d2a64a26740982587baab2f5938210bdba9accc (patch)
treef4802768e4a06b30e60d70cbe6f870f65492823f /APLDemo
parent92597a2d660285cf32eb0b88ec3d00b4fd48156e (diff)
Add APLDemo acme script
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
+