Bug 236

James Robertson jameswrobertson at earthlink.net
Wed Dec 11 20:17:46 PST 2002

Mark Hymers wrote:
> On Wed, 11, Dec, 2002 at 09:44:34AM -0600, James Robertson spoke thus..
>> James Robertson wrote:
>>> BLFS Editors,
>>> I have finished a first stab at bug 236 for the page titled
>>> /etc/profile and ~/.bash_*.  Let me know what I need to do further or
>>> if changes are needed.
>> Oops - I meant to send the patch file.  Sorry.
> Hi,
> I've been reviewing the patch and in the main it's fine.
> I've made one or two slight changes (grammatical and spelling mainly).
> One point; when you want to use things like <email at email.com>, you need
> to use < for < and > for > in XML or the parser gets confused (it
> can't tell the difference between that and a tag such as <sect2>)

OK, no problem there.  This is my first time with XML type authoring.  I
have done HTML, but not XML.  I looked over the patch and there are some
places that would use those tags in 1.2.  I can send a patch file again, or
just point them out to you.

> One or two other points.
> This bit in /etc/profile:
> # Setup some environment variables.
> USER=$(id -un)
> MAIL="/var/mail/$USER
> HOSTNAME=$(/bin/hostname)
> PS1="[\u@\h \w]\\$ "
> I'm fine with HISTSIZE and PS1 but USER, LOGNAME and HOSTNAME should
> (afaik) be set by default.  Secondly, it's probably dangerous for us to
> recommend the MAIL variable because depending on how people set up their
> mail, they might want it set differently.  Actually, having just tested
> it, MAIL is set to /var/mail/$USER by default anyways (unless I've made
> a mistake).  I've removed these for now but if you want them added back
> in then just let me know - especially if my logic / testing is wrong.

Well...I am a visual guy.  I don't like (what I consider) major hidden
environment variables.  I like to see $USER, $LOGNAME, and $HOSTNAME when I
type env at the prompt.  I also wanted to make sure that $USER and $LOGNAME
were the same.  I see these as major and the two distros that I have used
in the past (RH and Debian) also place those same lines in thier
/etc/profile files.  On the $MAIL issue, I can put some verbiage in there
that if you moved your mail location from the default in the lfs book, then
you need to change the variable here.  This is another good reason to keep
that variable.  By default it is in /var/mail/$USER, but it could be moved
anywhere.  The FHS recommends /var/spool/mail/$USER, so some people could
have moved it there.  I don't care either way, it is just the way I liked
it.  If you want it different in your book, then by all means remove it.

> # By default we want the umask to get set.
> # Even for non-interactive and non-login shells.
> Again, my testing shows that umask is set to 022 by default anyhow.  I
> agree that the code to set it for some users to 002 is good but should
> it just be for UID=0 (i.e. root)?

I just wanted to make sure it was set correctly not matter what setup
someone had.  I got some wierd results on my test box.  The code "if [
"$(id -gn)" = "$(id -un)" -a $(id -u) -gt 99 ]" will pretty much get anyone
not uid -0.  I got this snippet from a google search I did because again I
was getting weird results.  Someone else on the net was having issues as
well and when I tried it on my lfs 4.0 box it always worked (essentially
doing a if [ ! "$(id -u)" = 0 ]" did not always get me what I wanted.

> Anyways, other than for those two minor points, that's about it - it is
> otherwise excellent and will be committed to CVS in the next few
> minutes.

Cool!  I can't wait to see it on the CVS view on the website.  I never did
get the rendering stuff to work.

> Thanks very much,
> Mark

You are very welcome.  I found it fun and educational.

Actually I was doing some playing with my prompt today (and /etc/issue).  I
found a howto on tldp.org and discovered the wonderful world of escape
sequences.  I was thinking of putting a small snippet in the page on making
fun or unique PS1's - think that is useful?

Also, the /etc/bashrc or ~/.bashrc should have some code in it for XTerm
windows.  There is some code needed there for setting up the title bar and
doing colors in XTerms.  Should I look into that as well?  I would probably
need to section up the page like - required, fun, XWindows or something.
Let me know what you want to do.

Also, if you have other areas that need fill in (like some of the
introductions) or whatever, let me know.  I would love to contribute more
if you need it.

James Robertson | jameswrobertson at earthlink.net
Reg. Linux User: #160424  http://counter.li.org
Reg. LFS User:   #6981    http://www.linuxfromscatch.org

Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-book' in the subject header of the message

More information about the blfs-book mailing list