2021年4月4日星期日

Is there a better way rather than `source ~/.bashrc` after I edit my .bashrc?

There is some line in my ~/.bashrc:

...  export PATH="/XXX/YYY/ZZZ:$PATH"  export PATH="/AA/BB:$PATH"  ...  

And maybe I edit it one day:

...  # export PATH="/XXX/YYY/ZZZ:$PATH"  # export PATH="/AA/BB:$PATH"  export PATH="/CC/DD:$PATH"         # new line  export PATH="/EE/FF:$PATH"         # new line  ...  

Usually I saw the tutorial just source ~/.bashrc to update it after editing. But in my case, it'll lead to :

$ echo $PATH  /EE/FF:/CC/DD:/AA/BB:/XX/YY/ZZ:(Original PATH)  

/AA/BB, /XX/YY/ZZ still in there. It force me to close the session and open a new one.

So, is there a better way for update ~/.bashrc?

https://stackoverflow.com/questions/66947485/is-there-a-better-way-rather-than-source-bashrc-after-i-edit-my-bashrc April 05, 2021 at 10:03AM

没有评论:

发表评论