在bash shell脚本中重新加载.profile(在UNIX中)? [英] Reload .profile in bash shell script (in unix)?

查看:279
本文介绍了在bash shell脚本中重新加载.profile(在UNIX中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是bash shell脚本的新手,遇到了挑战.我知道我可以通过以下方式重新加载".profile"文件:

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

但是我试图在我正在编写的bash脚本中执行相同的操作,但这只是无法正常工作. 有任何想法吗?我还有什么要澄清的吗?

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?

谢谢

推荐答案

尝试使用此方法重新加载当前的shell:

Try this to reload your current shell:

source ~/.profile

这篇关于在bash shell脚本中重新加载.profile(在UNIX中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆