Quote EOF so that bash takes inputs literally:
EOF
bash
cat <<'EOF' > what.txta=`echo $1 | awk -F. '{print $NF}'`b=`echo $2 | tr '[:upper:]' '[:lower:]'`EOF
Also start using $() for command substitution instead of old and problematic ``.
$()