#! /bin/sh

# Solaris' /bin/sh is too fscking broken. Use ksh instead
uname | grep >/dev/null SunOS && \
  [ -z "$SUNOS_SH_WORKAROUND" ] && \
    exec env SUNOS_SH_WORKAROUND=true /bin/ksh "$0" "$@"

echo lsh, test 11

if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
fi

. $srcdir/functions.sh

rm -f test.out1

BOGUS_ENV_VARIABLE=junk
export BOGUS_ENV_VARIABLE

spawn_lshd && run_lsh env > test.out1 || test_fail

home_seen=no

while IFS='=' read name value ; do
    case $name in
	HOME)
	  [ "$value" = "$TEST_HOME" ] || test_fail
	  home_seen=yes
	;;
	BOGUS_ENV_VARIABLE)
	  test_fail
	;;*)
	  :
    esac
done <<EOF
`cat test.out1`
EOF

[ $home_seen = yes ] && test_success

test_done
