twintext: use rc not bash - 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 0bd14783426d137428ffae7cd89cfc06b88d1b11
DIR parent 0a7fe606818a7906cdc57ea14cb57b416be6c1de
HTML Author: Russ Cox <rsc@swtch.com>
Date: Wed, 30 Dec 2020 07:21:44 -0500
wintext: use rc not bash
Diffstat:
M bin/wintext | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
---
DIR diff --git a/bin/wintext b/bin/wintext
t@@ -1,22 +1,17 @@
-#!/bin/bash
+#!/usr/local/plan9/bin/rc
-case "$winid" in
-[0-9]*)
+if(~ $winid [0-9]*) {
9p read acme/$winid/body
exit 0
-esac
-
-case "$text9term" in
-unix!*)
- dial -e $text9term </dev/null
+}
+if(~ $text9term 'unix!'*) {
+ dial -e $text9term < /dev/null
exit 0
-esac
-
-case "$TMUX" in
-?*)
+}
+if(~ $TMUX ?*) {
tmux capture-pane -p
exit 0
-esac
+}
-echo 'no running window found' 2>&1
+echo 'no running window found' >[2=1]
exit 1