summaryrefslogtreecommitdiffstats
path: root/src/kash/tests/pipe-2
diff options
context:
space:
mode:
Diffstat (limited to 'src/kash/tests/pipe-2')
-rw-r--r--src/kash/tests/pipe-230
1 files changed, 30 insertions, 0 deletions
diff --git a/src/kash/tests/pipe-2 b/src/kash/tests/pipe-2
new file mode 100644
index 0000000..6ba2637
--- /dev/null
+++ b/src/kash/tests/pipe-2
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Pipes input from an builtin command thru an external one.
+
+. ${KASH_TEST_DIR}/common-include.sh
+
+TMPFILE1="/tmp/pipe-2a.$$.tmp"
+TMPFILE2="/tmp/pipe-2b.$$.tmp"
+echo piped > $TMPFILE1
+$CMD_CAT $TMPFILE1 \
+ | $CMD_SED -e 's/piped/abc/' \
+ | $CMD_SED -e 's/abc/def/' \
+ | $CMD_SED -e 's/def/ghi/' \
+ | $CMD_SED -e 's/ghi/jkl/' \
+ | $CMD_SED -e 's/jkl/mno/' \
+ | $CMD_SED -e 's/mno/pqr/' \
+ | $CMD_SED -e 's/pqr/stu/' \
+ | $CMD_SED -e 's/stu/vwx/' \
+ | $CMD_SED -e 's/vwx/yz_/' \
+ > $TMPFILE2
+
+VAR=`$CMD_CAT $TMPFILE2`
+$CMD_RM -f -- $TMPFILE1 $TMPFILE2
+if test "$VAR" != "yz_"; then
+ echo "pipe-2: FAILURE - VAR=$VAR"
+ exit 1
+fi
+echo "pipe-2: SUCCESS"
+exit 0
+