Why is Terminal complaining "-bash: export: `PATH;': not a valid identifier" When I start terminal I get the error 


  -bash: export: `PATH;': not a valid identifier  


Why?

I've looked in the two files which I think bash uses at startup, and I cannot see an issue:

/etc/profile

# System-wide .profile for sh(1)  

if [ -x /usr/libexec/path_helper ]; then  
        eval `/usr/libexec/path_helper -s`  
fi  

if [ "${BASH-no}" != "no" ]; then  
        [ -r /etc/bashrc ] &amp;&amp; . /etc/bashrc  
fi  


~/.bash_profile

export PATH="$PATH:/usr/local/autoconf/bin"  
export PATH="$PATH:/usr/local/automake/bin"  
export VISUAL=vscodeeval $(/usr/libexec/path_helper -s)  


(N.B. The file /usr/libexec/path_helper is binary, and /etc/bashrc does not contain the text 'PATH'.)

Where is the error coming from? I cannot see PATH; with the trailing semicolon in either startup profile.
Look at the output of path_helper -s:

$ /usr/libexec/path_helper -s
PATH="..."; export PATH;


(The actual value assigned to PATH isn't important; I've elided it here.)

The output is intended to be executed with eval, as it is in /etc/profile. The purpose is to provide an initial value for the PATH variable, then set the export attribute on the name.

In your .bash_profile, you are unnecessarily executing it again, but also incorrectly letting the output be used as additional arguments to an export command. The line

export VISUAL=vscodeeval $(/usr/libexec/path_helper -s) 


is treated as 

export VISUAL=vscodeeval PATH="..."; export PATH;


except the semicolons are treated as literal characters, not command terminators. Thus, it tries to do the following:


Set VISUAL to vscodeval and set the export attribute on VISUAL. That's OK.
Set PATH to an initial value (ending with a semicolon, which would not be what you want, but syntactically not an issue) and set its export attribute.
Set the export attribute on a variable named export. Unnecessary, but not an error.
Set the export attribute on a variable named PATH;. That is your error, since a variable name cannot contain a ;.


The fix is to just remove the $(/usr/libexec/path_helper -s) from your .bash_profile; it only needs to be executed once from /etc/profile.