mac solves the problem that setting environment variables makes vim and other commands invalid

Reason: Environment variable setting error
1. Type in the command line
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
This ensures that command-line commands are temporarily available. Do not close the terminal after the command is executed
Or execute the vi command under cd /usr/bin
2. If the bash_profile restore file was previously modified,
you ~ / .bash_profile
 
3. It is very likely that your PATH environment variable is set incorrectly, for example, $PATH is missing
PATH=$PATH:$PATH1
Can be written in this format: export PATH=/usr/local/msyql/bin: $PATH
4. Effective immediately, source ~/.bash_profile

5. The same is true for the previous modification of /etc/profile

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324862258&siteId=291194637