From a45dfa38b8042512137741381e50b25197357591 Mon Sep 17 00:00:00 2001 From: "Haoran S. Diao" <0@hairydiode.xyz> Date: Sun, 15 Sep 2019 17:19:30 -0700 Subject: initial commit --- README | 6 ++++++ connd | 10 ++++++++++ mc.in | 4 ++++ mc.out | 27 +++++++++++++++++++++++++++ serverd | 4 ++++ 5 files changed, 51 insertions(+) create mode 100644 README create mode 100755 connd create mode 100644 mc.in create mode 100644 mc.out create mode 100755 serverd diff --git a/README b/README new file mode 100644 index 0000000..d27b36a --- /dev/null +++ b/README @@ -0,0 +1,6 @@ +script for spawning a terminal independent process with stdin and stdout at +mc.in and mc.out respectively + +serverd $COMMAND starts the process +connd in the same directory as mc.in and mc.out will connect to it +typeing "quitd" will disconnect from the process diff --git a/connd b/connd new file mode 100755 index 0000000..71a05f0 --- /dev/null +++ b/connd @@ -0,0 +1,10 @@ +#!/bin/bash +tail -f mc.out & +while true; do + read input + if [ "$input" == "quitd" ]; then + kill %1 + exit + fi + echo $input >> mc.in +done diff --git a/mc.in b/mc.in new file mode 100644 index 0000000..2ef19de --- /dev/null +++ b/mc.in @@ -0,0 +1,4 @@ + +ls +cd ~ +ls diff --git a/mc.out b/mc.out new file mode 100644 index 0000000..c11bf4d --- /dev/null +++ b/mc.out @@ -0,0 +1,27 @@ +connd +mc.in +mc.out +readme +serverd +Android +Arduino +AUR +Bioshock +cad +code +Desktop +Downloads +Games +GIS +go +GOG Games +infostash +lang +My Games +other +phone +Songs +ucla +Webcam +work +论 diff --git a/serverd b/serverd new file mode 100755 index 0000000..f33abb5 --- /dev/null +++ b/serverd @@ -0,0 +1,4 @@ +#!/bin/bash +echo "" > mc.in +echo "" > mc.out +tail -f mc.in | nohup $1 > mc.out & -- cgit v1.1