I am having some trouble trying to load my .bashrc file through the bash Chef resource. My .bashrc is located in /sh/.bashrc This is my resource code:
bash "Source .bashrc" do
cwd "/home/ameya"
user "ameya"
code "source /sh/.bashrc"
action :run
end
My .bashrc has only the following bit:
export ME=ameya
So when I type echo $ME at the terminal I expect to see it print out ameya but nothing gets printed out. What is wrong with the way I have set things up? Thanks in advance
The
.bashrcfor the userameyais/home/ameya/.bashrc. If you want it to run a shared file, you might do the following:When Chef runs
/home/sh/.bashrc, the effect only lasts as long as that single shell instance, started by Chef, is running. If you want the effects of a.bashrcfile to take effect on every interactive shell invocation, you need to arrange for it to be source'd during that startup process.