Prompt when Linux source /etc/profile: bash: pathmunge: command not found

The problem is as follows:

 Troubleshooting ideas: The source profile prompts that no command is found, indicating that there is a problem with this pathmunge, or it does not exist

cat /etc/profile Check the definition and related codes about pathmunge in it:

The problem can be clearly found: there is no pathmunge function in it at all, and I don’t know why there is an e missing. It can be completed by vi /etc/profile to form a complete function of pathmunge(){...}. ECS exits the editing mode of vi, keyboard input: wq! Forced to save and exit 

Then source /etc/profile to see the effect

That's OK. Therefore, you must make a backup before modifying the system profile. If you make a mistake and don’t remember where you changed it, it will be more troublesome.  Remember to back up before modifying the profile, remember to back up, remember to back up!  

Of course, if it is wrong, then think of a way and change it to the correct one~~

Guess you like

Origin blog.csdn.net/yeyuningzi/article/details/130641151