Reload .profile in bash shell script (in unix)?

Amir Rustamzadeh picture Amir Rustamzadeh · Jul 18, 2010 · Viewed 174.5k times · Source

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

Answer

kofriel picture kofriel · Feb 20, 2012

Try this to reload your current shell:

source ~/.profile