On Thursday 19 May 2005 20:32, Holly Bostick wrote:

>  $ java-config -s sun-jre-bin-1.5.0.03
> Env files in /home/motub/.gentoo updated. Source these in your
> shell's profile.
>
> Am I the only one who doesn't know quite what to do at this point?
> I did figure it out, but I don't find this message at all clear,
> since the only 'source' I've done up to this point is 'source
> /etc/profile', which is of course not available to me as a user.

As long as /etc/profile is readable, it *is* available to you as a 
user. Try:

$ source /etc/profile
$

Actually, it gets sourced each time you login.

> Fine, so then I do
>
> $ source ~/.gentoo/*
>
> and then I was able to get
>
> $ java-config -f
> sun-jre-bin-1.5.0.03

"source" only sources one file. That way only the first file in 
~/.gentoo gets sourced. If that directory had only one file in it, 
your command worked just fine.
But I think the right way (handles multiple source files) is

for i in ~/.gentoo/*; do source $i; done

> (And now Azureus opens the Configuration tab without crashing,
> yay!) But I know I was just lucky. I was making this up/guessing
> wildly as I went along. That command worked, but I don't even know
> if that's "right" (the asterisk). I suppose the source command
> sensibly only sourced the "source-able" files in that folder, but I
> don't know which ones they were, what needed to change, or if
> everything that needed to change in fact did.

Executing a "source" command ("." can be used as a shortcut, eg 
. /etc/profile) means: read the given file (typically containing a 
shell script or export of shell variables), and execute all the 
commands you find there *in the current shell*. This is equivalent to 
typing each line contained in the file at the shell prompt.
This is different from running a shell script, since in this case the 
script is run in a subshell, and (among other things) all the 
modifications it does to environment variables are lost after it 
terminates.
What the java-config message was asking you was to source the files in 
~/.gentoo, to read in the new values for the environment variables 
and have the changes in effect immediately.

man bash will give you more details about the "source" command.

HTH
-- 
[email protected] mailing list

Reply via email to