Alexander E. Patrakov wrote:
> Hello,
> 
> the "bash shell startup files" section can be improved:
> 
> 1) /etc/profile tests for EUID=0 in two different ways:
> 
> |if [ $EUID -eq 0 ] ; then
>         pathappend /sbin:/usr/sbin
>         unset HISTFILE
> fi|
> 
> 
> |if [[ $EUID == 0 ]] ; then
>   PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
> else
>   PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
> fi
> 
> |
> 
> Please remove the "==" construction, it is completely unneeded here, 
> "-eq" works just fine. Also, "#" can be replced with "\$", too.

Although you are correct about unneeded, I think it should remain as a
demonstration of different techniques.

> 2) /etc/profile.d/extrapaths.sh uses the [ -d /usr/local/sbin -a $EUID 
> -eq 0 ] construction, but the "-a" doesn't work in all shells (try 
> posh). Suggestion: [ -d /usr/local/sbin ] && [ $EUID -eq 0 ]

The title of the section is "Bash Shell Startup Files".  I prefer to
leave this alone, although I wouldn't be opposed to making the comment
in the descriptive text that some constructs in the files are Bash
specific and may not run in all shells without modification.  After all,
they won't run at all in tcsh.

> 3) /etc/profile.d/readline.sh is completely unneeded - readline-5.2 
> looks in /etc/inputrc by default.

But it does show how to change things if the default is not used.
Again, a comment that it is unnecessary if using the defaults wouldn't
hurt, but I think the example should remain.

> 4) It should be mentioned that umask (as set in the book) doesn't work 
> for non-shell logins (e.g., scp or svn-over-ssh). A recommendation to 
> use pam-umask 
> (http://ftp.debian.org/debian/pool/main/p/pam-umask/pam-umask_0.04.tar.gz) 
> may be more suitable.

In my opinion, pam is a PITA.  It is useful in multi-user environments,
but shouldn't be a default for BLFS.  The top of the section does
already says that non-login shells normally only run ~/.bashrc.  Perhaps
more examples may be useful, but we can't really cover every
circumstance where a non-login shell is run.

  -- Bruce


-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to