summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran S. Diao <0@hairydiode.xyz>2019-09-15 17:19:30 -0700
committerHaoran S. Diao <0@hairydiode.xyz>2019-09-15 17:19:30 -0700
commita45dfa38b8042512137741381e50b25197357591 (patch)
treed95e813aa790c0c5ee00e746e22134ae341ac1e0
initial commit
-rw-r--r--README6
-rwxr-xr-xconnd10
-rw-r--r--mc.in4
-rw-r--r--mc.out27
-rwxr-xr-xserverd4
5 files changed, 51 insertions, 0 deletions
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 &