Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 89367 - UTF-8 guide recommends to use ~/.profile but bash doesn't read it
Summary: UTF-8 guide recommends to use ~/.profile but bash doesn't read it
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Desktop Configuration Guide (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-16 18:00 UTC by Thomas K
Modified: 2005-06-02 11:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
utf-8.xml.diff (utf-8.xml.diff,2.02 KB, patch)
2005-05-25 14:43 UTC, Jonathan Smith (RETIRED)
Details | Diff
utf-8.xml.diff (utf-8.xml.diff,2.03 KB, patch)
2005-05-29 17:51 UTC, Jonathan Smith (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas K 2005-04-16 18:00:31 UTC
In the paragraph "Setting the Locale", it is said:

"Instead, it is best to set the locale in your user's ~/.profile (or, if you are using a C shell, ~/.login).

Note: If you are not sure which file to use, use ~/.profile. Also, if you are unsure which code listing to use, use the Bourne version."

Actually, bash doesn't look for a .profile file but for a .bash_profile one instead. Adding the environment variables in the latest one works.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 SpanKY gentoo-dev 2005-04-16 19:42:08 UTC
bash does read ~/.profile, but only if you dont have other files in place already

from the manpage:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
Comment 2 Thomas K 2005-04-21 01:41:15 UTC
I'm sorry for not reading properly the man page, but I was relying on the FILES section which doesn't mention ~/.profile ...

And from reading it carefully, here's another little problem:
"If bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order."

I'm not on my gentoo box right now, but I'm pretty sure I had the ~/.bash_profile file created by bash on my first login (which would explain why I had that issue with the ~/.profile one). I think it would be a good idea to notify bash users that they should add the environment variables in both files, so whether they invoke bash or sh, unicode is used. That is, while it's not recommended by devs to put them in /etc/profile.
Comment 3 Shyam Mani (RETIRED) gentoo-dev 2005-04-21 02:00:20 UTC
I'm pretty sure that I had to create a .bash_profile in Gentoo (Not the case with other Distros like RH or Fedora) and by default, there was NO .bash_profile in my home directory...
Comment 4 SpanKY gentoo-dev 2005-04-21 05:41:49 UTC
you both are almost correct

/etc/skel/ contains a .bash_profile ... that means if you use a utility such as `useradd` to create your user, the file will be automatically copied to your $HOME/ ... however if you create the user manually, the file will probably not be auto copied to your $HOME

the reason we do not recommend using /etc/profile is that:
(1) that is a global file which affects all users on your box
(2) that file will be constantly updated by baselayout and trigger `etc-update` merges with it which could easily cause your change to get lost :/
Comment 5 Jonathan Smith (RETIRED) gentoo-dev 2005-05-25 14:43:34 UTC
Created attachment 59820 [details, diff]
utf-8.xml.diff

this should fix all of the aforementioned problems
Comment 6 Jonathan Smith (RETIRED) gentoo-dev 2005-05-29 17:51:11 UTC
Created attachment 60134 [details, diff]
utf-8.xml.diff

sorry, the last one wasn't word-wrapped correctly... this one is
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2005-06-02 11:51:24 UTC
Fixed in CVS.