[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 6:37 PM, Rodolfo Medina <rodolfo.medina@gmail.com> wrote:
> Lisi Reisz <lisi.reisz@gmail.com> writes:
>
>>>> I added the following lines to /etc/profile:
>>>>
>>>> export XMODIFIERS=@im=SCIM
>>>> export GTK_IM_MODULE=scim
>>>> export QT_IM_MODULE=scim
>
>
> Rodolfo Medina wrote:
>
>>> How can I get the same result *without* putting that stuff in /etc/profile?
>>> I mean, if I put that in /etc/profile, those commands are run at every boot,
>>> wheraes I want to run them at my pleasure.  If I simply give them from
>>> command line:
>>>
>>>  # export XMODIFIERS=@im=SCIM
>>>  # export GTK_IM_MODULE=scim
>>>  # export QT_IM_MODULE=scim
>>>
>>> they don't seem to take any effect.
>
>
> Aneurin Price <aneurin.price@gmail.com> writes:
>
>
>> What is it you're actually trying to do? Those environment variables should
>> be set for the shell you typed that into, and any child processes. They won't
>> be set globally because, as far as I know, there's no way to set the
>> environment for a parent process. This means that if you're opening up an
>> xterm or whatever and entering those variables then they will take effect for
>> anything started from that xterm, but not for anything else. To have them set
>> across the board you would need them set earlier - like in /etc/profile as
>> you've discovered, or your user's config files.
>
>
> All right, that answers my question, thanks.  Now, I put those lines in a
> script:
>
> #!/bin/bash
> export XMODIFIERS=@im=SCIM
> export GTK_IM_MODULE=scim
> export QT_IM_MODULE=scim
>
> , made it executable with `chmod 755' but it doesn't seem to work.  Why?
>

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.

Does that answer your question?

Nye


Reply to: