Reload .profile in bash shell script (in unix)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to bash shell scripting, and have come across a challenge. I know I can reload my ".profile" file by just doing: . .profile but I'm trying to execute the same in a bash script I'm writing and it is just not working. Any ideas? Anything else I can provide to clarify? Thanks 回答1: Try this to reload your current shell: source ~/.profile 回答2: Try this: cd source .bash_profile 回答3: The bash script runs in a separate subshell. In order to make this work you will need to source this other script as well. 回答4: A couple of issues arise when