shell=dtksh
nl='
'
i=1
script='.'
x=XXX
long_var=XXX
export x long_var
unset foo
while test $i -le 3100
do
  if test $i -gt 1000
  then
    for expansion in '$x' '${x}' '$long_var' '${long_var}' '${foo-XXX}' '`echo X""XX`'
    do
      echo "cat >t <<EOF
$script$expansion
EOF" > ts
      if $shell ts; then
	if grep XXX t >/dev/null; then :; else
	  echo "Silent breakage at i=$i with $expansion"
	fi
      else
	echo "Breakage at i=$i with $expansion"
      fi
    done
  fi
  case $i in
  *50|*00) script=$script$nl;;
  *)       script=$script.;;
  esac
  i=`expr $i + 1`
done
