Rereading of .bash_profile
barry at hartford.uconn.edu
Tue Jan 2 12:05:44 PST 2001
Fabio Fracassi wrote:
> On Saturday 30 December 2000 10:15, you wrote:
> > : On Sat, 30 Dec 2000 00:19:02 -0500, Perrin Aybara wrote:
> > :
> > >The period, as far as I
> > >know, pretty much stands for "run this".
> > The "." is the same as "source"
> that is not true, a "." before a filename makes the file "hidden", i.e. ls
> without special parameters does not show them. (Unix has no hidden attribut)
> as for using "sh" or "source", there is a great difference, since "sh" starts
> a new shell and executes the script in that new shell (the old one remains
> and wastes resources), whereas "source" executes it in the same shell.
> if ~/.bash_profile has execute permisions, the source is assumed by bash if
> you execute a text file.
OK OK, hehe...
I didn't mean to start an argument...
the people who have detailed the use of 'source' here have prescribed a
better way to do it than I did... I will admit that. I was answering
the question quickly before I left work that night. Mia Culpa :) - the
use of source to reread the variables had not crossed my mind.
Yes, there is a major difference. That effective difference, in this
case, is that the user would have to type exit (or logout,whichever most
people feel is more appropriate) twice instead of the customary once.
yes, sh, bash, bash2 whatever your system lists as the shell file name,
will open a new subshell... what I was thinking about was that old sysV
method of running programs, sh <program> ...
What I had neglected to think about was that most programs run in this
manner return to the shell, exiting the newly spawned shell which ran
when you launch a new shell in the manner I suggested, you must manually
exit the shell.
However, I say that the source method is better, not the "right" way
the question was "how do I get .bash_profile to be re-read by the
shell?" Either of these answers would have effectively appeared to do
that... until the user attempted to exit. In this case, it would cause
temporary confusion when the contents of the command prompt did not
return to those of the base distro...
both methods would get the user where they wanted to be...but source is
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message
More information about the lfs-dev