LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-05-2004, 10:27 PM   #1
exitsfunnel
Member
 
Registered: May 2003
Distribution: RedHat
Posts: 60

Rep: Reputation: 15
Trouble setting environment variable


Hello,

I'm currently running RHEL 3.0. When I start the machine it boots to an X login screen at which I login into Gnome as a non root user. I then launch a gnome-termnal. In this terminal 'echo $LANG' yields en_US.UTF-8. I'd like this value to autmatically be set to just en_US. I can't figure out though where to specify this. I've tried adding 'export LANG=en_US' to both /etc/profile and the users .bash_profile but neither had any affect. Is there some kind of X startup file I can add commands to? I'm a little confused about the interaction between X and bash I guess. Thanks in advance!

-exits
 
Old 10-06-2004, 12:29 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I'd suggest helping yourself by using
grep in /etc ... and setting it globally...

grep -R LANG /etc/*


Cheers,
Tink
 
Old 10-06-2004, 01:30 AM   #3
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
The thing with /etc/profile is that it's only used by bash when it's a login shell, which is not what happens by default when you open your xterm (or gnome-term). /etc/bash.bashrc and ~/.bashrc are usually used for a non-login shell.
 
Old 10-06-2004, 06:35 AM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
You could use an xsession script to start Gnome and set it there. Create the file ~/.xsession and add the this:
Code:
LANG=en_US &
exec gnome-session
Set your session type to "Custom session" in GDM (if that's what you use) and you should log in to a Gnome desktop with en_US as the language. Since $LANG will be inherited by gnome-session and we set it before we launch the session manager your entire environment should be en_US.


Håkan
 
Old 10-06-2004, 06:49 AM   #5
CroMagnon
Member
 
Registered: Sep 2004
Location: New Zealand
Distribution: Debian
Posts: 900

Rep: Reputation: 33
If you follow hw-tph's excellent advice, you could also go the whole hog and replace the LANG= line with
Code:
source /etc/profile
so your X session has your entire normal environment - then you'd only need to edit /etc/profile in future.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
environment variable setting chii-chan Linux - General 5 01-23-2009 07:29 PM
setting environment variable kb_ganesh Ubuntu 3 09-10-2005 01:58 PM
Setting up a environment variable Hiper1 Linux - Newbie 3 03-08-2005 08:43 AM
setting environment variable DISPLAY jpan Debian 4 10-15-2004 06:09 PM
Setting an environment variable kharris Linux - General 3 10-02-2003 04:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration