Last change
on this file since 3452 was 3452, checked in by bird, 4 years ago |
kash: tests/pipe-2 can't be using the same file in both ends of the pipe.
|
-
Property svn:eol-style
set to
LF
|
File size:
682 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | # Pipes input from an builtin command thru an external one.
|
---|
4 |
|
---|
5 | . ${KASH_TEST_DIR}/common-include.sh
|
---|
6 |
|
---|
7 | TMPFILE1="/tmp/pipe-2a.$$.tmp"
|
---|
8 | TMPFILE2="/tmp/pipe-2b.$$.tmp"
|
---|
9 | echo piped > $TMPFILE1
|
---|
10 | $CMD_CAT $TMPFILE1 \
|
---|
11 | | $CMD_SED -e 's/piped/abc/' \
|
---|
12 | | $CMD_SED -e 's/abc/def/' \
|
---|
13 | | $CMD_SED -e 's/def/ghi/' \
|
---|
14 | | $CMD_SED -e 's/ghi/jkl/' \
|
---|
15 | | $CMD_SED -e 's/jkl/mno/' \
|
---|
16 | | $CMD_SED -e 's/mno/pqr/' \
|
---|
17 | | $CMD_SED -e 's/pqr/stu/' \
|
---|
18 | | $CMD_SED -e 's/stu/vwx/' \
|
---|
19 | | $CMD_SED -e 's/vwx/yz_/' \
|
---|
20 | > $TMPFILE2
|
---|
21 |
|
---|
22 | VAR=`$CMD_CAT $TMPFILE2`
|
---|
23 | $CMD_RM -f -- $TMPFILE1 $TMPFILE2
|
---|
24 | if test "$VAR" != "yz_"; then
|
---|
25 | echo "pipe-2: FAILURE - VAR=$VAR"
|
---|
26 | exit 1
|
---|
27 | fi
|
---|
28 | echo "pipe-2: SUCCESS"
|
---|
29 | exit 0
|
---|
30 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.