aboutsummaryrefslogtreecommitdiffstats
path: root/tests/coproc.tests
diff options
context:
space:
mode:
authorcvpcs <root@cvpcs.org>2010-06-02 11:02:31 -0500
committercvpcs <root@cvpcs.org>2010-06-02 11:02:31 -0500
commit772f20abb0a3a0979c440114bf3a1cff5b3cef03 (patch)
tree3384b9291d73a12542c526a8557218c7435491b0 /tests/coproc.tests
downloadexternal_bash-772f20abb0a3a0979c440114bf3a1cff5b3cef03.zip
external_bash-772f20abb0a3a0979c440114bf3a1cff5b3cef03.tar.gz
external_bash-772f20abb0a3a0979c440114bf3a1cff5b3cef03.tar.bz2
initial import of bash 4.1
Diffstat (limited to 'tests/coproc.tests')
-rw-r--r--tests/coproc.tests45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/coproc.tests b/tests/coproc.tests
new file mode 100644
index 0000000..8be3563
--- /dev/null
+++ b/tests/coproc.tests
@@ -0,0 +1,45 @@
+coproc { echo a b c; sleep 2; }
+
+echo $COPROC_PID
+echo ${COPROC[@]}
+
+read LINE <&${COPROC[0]}
+echo $LINE
+
+wait $COPROC_PID
+
+coproc REFLECT { cat - ; }
+
+echo $REFLECT_PID
+echo ${REFLECT[@]}
+
+echo flop >&${REFLECT[1]}
+read LINE <&${REFLECT[0]}
+
+echo $LINE
+
+kill $REFLECT_PID
+wait $REFLECT_PID
+
+coproc xcase -n -u
+
+echo $COPROC_PID
+echo ${COPROC[@]}
+
+echo foo >&${COPROC[1]}
+read <&${COPROC[0]}
+
+echo $REPLY
+echo ${COPROC[@]}
+
+cat /etc/passwd | grep root | awk -F: '{print $1;}' | sed 1q
+
+exec 4<&${COPROC[0]}-
+exec >&${COPROC[1]}-
+
+echo ${COPROC[@]}
+
+read foo <&4
+echo $foo >&2
+
+exit 0