summaryrefslogtreecommitdiff
path: root/migdon/bash_migdeon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'migdon/bash_migdeon.sh')
-rwxr-xr-xmigdon/bash_migdeon.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/migdon/bash_migdeon.sh b/migdon/bash_migdeon.sh
new file mode 100755
index 0000000..95bd7ca
--- /dev/null
+++ b/migdon/bash_migdeon.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+PPID=`ps -o ppid -p $$`
+
+echo parent PID $PPID
+
+PTTY=`ps -p $PPID -o tty --no-headers`
+
+echo parent TTY $PTTY
+
+while IFS= read -r line; do
+ echo "read one line";
+done
+
+while IFS= read -r line; do
+ echo "read one line 2";
+done < /dev/$PTTY