Bash tries to execute commands in heredoc Bash tries to execute commands in heredoc shell shell

Bash tries to execute commands in heredoc


Quote EOF so that bash takes inputs literally:

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 ``.