[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A question about /etc/profile (was: Scim does not work with openoffice)



On Thu, Feb 5, 2009 at 7:35 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Aneurin Price <aneurin.price@gmail.com> writes:
>
>> Let's say you've saved this as 'script', and you're running '$./script' or
>> '$bash script'. What that will do is spawn a new bash process which
>> interprets the script, and then exits. If you want the variables to be set in
>> the shell you started from, rather than starting a new bash process, you
>> shouldn't run the script but instead 'source' it, like '$source script'. This
>> tells the existing shell to interpret the commands in the script, rather than
>> creating a new shell to do it.
>
>
>  $ source script
>
> has the same effect than running those three commands from command line.
> Instead, putting them in /etc/profile is more powerful, it gets more effects.
> It seems there's no alternative to that?
>

I'm not sure what you mean by 'more effects'. You can get the effect of
/etc/profile on a per user basis by adding commands to ~/.bash_profile (for bash
shells), ~/.profile (for most shells), ~/.xsession for X sessions - I *think*
this should be read by xdm/kdm/gdm and therefore work with any desktop
environment, but I'm not exactly sure how it's handled.
The one thing you can't do (so far as I know) is set variables for your whole
session *after* logging in.

Nye


Reply to: