Line: PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
should read:
PROMPT_COMMAND="history -a; \$PROMPT_COMMAND"
Line: PROMPT_ COMMAND= "history -a; $PROMPT_COMMAND"
should read:
PROMPT_ COMMAND= "history -a; \$PROMPT_COMMAND"