diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:21:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-11 08:21:29 +0000 |
commit | 29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc (patch) | |
tree | 63ef546b10a81d461e5cf5ed9e98a68cd7dee1aa /src/kash/tests/pipe-2 | |
parent | Initial commit. (diff) | |
download | kbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.tar.xz kbuild-29cd838eab01ed7110f3ccb2e8c6a35c8a31dbcc.zip |
Adding upstream version 1:0.1.9998svn3589+dfsg.upstream/1%0.1.9998svn3589+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/kash/tests/pipe-2')
-rw-r--r-- | src/kash/tests/pipe-2 | 30 |
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 + |