VirtualBox

source: kBuild/trunk/src/kash/tests/pipe-2@ 3452

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
7TMPFILE1="/tmp/pipe-2a.$$.tmp"
8TMPFILE2="/tmp/pipe-2b.$$.tmp"
9echo 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
22VAR=`$CMD_CAT $TMPFILE2`
23$CMD_RM -f -- $TMPFILE1 $TMPFILE2
24if test "$VAR" != "yz_"; then
25 echo "pipe-2: FAILURE - VAR=$VAR"
26 exit 1
27fi
28echo "pipe-2: SUCCESS"
29exit 0
30
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette