I get a bash syntax error message every time I open Terminal on macbook
Open /etc/bashrc_Apple_Terminal (requires sudo), replace

echo echo Restored session: $(date) &gt;| "$SHELL_SESSION_FILE"


with

echo echo \"Restored session: $(date)\" &gt;| "$SHELL_SESSION_FILE"


The point is to quote the echoed message.