#!/bin/sh

# Redirect input to an external command.

. ${KASH_TEST_DIR}/common-include.sh

TMPFILE="/tmp/redirect-3.$$.tmp"

echo 1 > $TMPFILE
echo 2 >> $TMPFILE
echo 3 >> $TMPFILE
VAR=`$CMD_SED -e '/2/!d' < $TMPFILE`
$CMD_RM -f $TMPFILE
if test "$VAR" != "2"; then
    echo "redirect-3: FAILURE - VAR=$VAR."
    exit 1
fi
echo "redirect-3: SUCCESS"
exit 0

