[PLUG] reloading? a config file

Michael D. Harris michael.harrisdmd at comcast.net
Fri Apr 29 04:12:59 UTC 2005


That was great help, thank you,

Mike

On Thu, 2005-04-28 at 21:04 -0700, Richard C. Steffens wrote:
> On Thursday 28 April 2005 8:31 pm, Michael D. Harris wrote:
> >    Is there a common way to re-initiate a file that you have added or
> > edited.  My real time example is the .bashrc file in my home directory
> > that I added an alias or two to.  What or where do I find instructions
> > on how to get the system to know that I edited it, or say, any other
> > file like that?
> 
> I discovered this one just the other day. In the tutorial for installing the 
> CAD program I'm trying, the writer described making changes to .bashrc. He 
> instructed me to run:
> 
> source bashrc
> 
> after saving the changes. 
> 
> I tried looking it up in "A Practical Guide to Linux" by Mark G. Sobell, the 
> text used when I took a Linux class a few years ago at Clackamas Community 
> College. The index for "source" sent me to . (dot) source, which sent me to . 
> (dot). Until I finally found out that there is a command called dot (.), I 
> was a bit confused. Here's some of what the book has to say:
> 
> ------------------------------------------------------------------------------
> Running .bash_profile with the . (Dot) Command
> 
> After you edit your .bash_profile file to change the values of keyword shell 
> variables, you do not have to wait until the next time you log in to put the 
> changes into effect. You can run .bash_profile with the . (dot) builtin. As 
> with all other commands, the . must be followed by a SPACE on the command 
> line. Using the . builtin is similar to running a shell script, except that 
> the . command runs the script as part of the current process. Consequently, 
> when you use . to run a script from your login shell, changes you make to the 
> variable from within the script affect the login shell. You can use the . 
> command to run any shell script, not just .bash_profile, but there may be 
> undesirable side effects (such as having the value of shell variables you 
> rely on changed). If you ran .bash_profile as a regular shell script and did 
> not use the . builtin, the new variables would be in effect only in the 
> subshell running the script.
> ------------------------------------------------------------------------------
> 
> I assume that there will be more experienced responses that will explain the 
> difference between .bash_profile, .bashrc, and .profile, but I think the 
> process is still valid. I put some environment variable assignments 
> in .bashrc and ran source .bashrc. The assignments were made, and I could see 
> the results with echo $VARIABLE.
> 
-- 

Michael D. Harris D.M.D. <michael.harrisdmd at comcast.net>
Linux Enthusiast




More information about the PLUG mailing list