![]() ![]() typing bash inside a bash instance) and looking at the output of env should give similar results than its parent. And they work like this:Įvery time a new process is started, if nothing happens, it inherits the environment of its parent. ![]() The actual problem is how environment variables work. The fact that it is is what's actually throwing you the command not found error, but it doesn't mean it would work if it were. The problem is not that source is a shell builtin command. The first would output the variable's value, but the second wouldn't output anything. I proved this by testing with these simple commands: echo $ENV_VARIABLE I found that while they could access the variables when I called the scripts directly (although, this would cause a later problem with creating directories as I needed to be root), calling the install scripts using sudo wouldn't. Initially, I was using some installer scripts which referenced the variables. Is there a simple way to load in the new bash profile settings for sudo without having to close the terminal and restart? I get the error: sudo: source: command not found When I try to use: sudo source /etc/bash.bashrc They only became available to sudo when I closed my terminal session and rejoined. The only thing is - the new environment variables were only available to my current user - and were ignored when I used sudo. I've been updating some of the default profile for bash, and saw from the tutorials I was following that I could reload the new profile with the new environment settings by using: source /etc/bash.bashrc ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |