I had this suggestions lying in my INBOX and I believe are worth pointing out. Even if programs do not rely or depend on an specific environment being set it is, for sure, a way to enhace the behaviour of many programs. Also notice that, regarding the complaints made by Bill, that scripts in profile.d can be forced to be fully POSIX compliant (like we do for maintainer scripts). Please do not shrug off the idea just because the implementations made by other distributions are bash-specific, we can make ours non-bash-specific if we wanted to. Regards Javier ----- Forwarded message from John Summerfield <XXXXXx> ----- From: John Summerfield <XXXXXXXXX> Date: Fri, 29 Nov 2002 17:28:49 +0800 I'm with you in this. It might help if you show some conveniences the idea offers. For example: ==> /etc/profile.d/bash.sh <== shopt -s checkwinsize ==> /etc/profile.d/colorls.sh <== # color-ls initialization COLORS=/etc/DIR_COLORS if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only if ! egrep -qi "^COLOR.*none" $COLORS &>/dev/null; then alias ll='ls -l ' alias l.='ls -d .[a-zA-Z]* ' alias ls='ls ' else alias ll='ls -l' alias l.='ls -d .[a-zA-Z]*' fi fi ==> /etc/profile.d/gnome-ssh-askpass.sh <== SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass export SSH_ASKPASS ==> /etc/profile.d/IBMjava.sh <== echo $PATH | grep -q :/opt/IBMJava2-13/bin: ||\ export PATH=$PATH:/opt/IBMJava2-13/bin:/opt/IBMJava2-13/jre/bin ==> /etc/profile.d/lang.sh <== # /etc/profile.d/lang.sh - set i18n stuff sourced=0 for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do [ -f $langfile ] && . $langfile && sourced=1 done if [ -n "$GDM_LANG" ]; then sourced=1 LANG="$GDM_LANG" fi if [ "$sourced" = 1 ]; then [ -n "$LANG" ] && export LANG || unset LANG [ -n "$LC_ADDRESS" ] && export LC_ADDRESS || unset LC_ADDRESS [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE [ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION || unset LC_IDENTIFICATION [ -n "$LC_MEASUREMENT" ] && export LC_MEASUREMENT || unset LC_MEASUREMENT [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES ==> /etc/profile.d/less.sh <== # less initialization script (sh) [ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="|/usr/bin/lesspipe.sh %s" if [ x`echo $LANG | cut -b 1-2` = x"ja" ]; then export JLESSCHARSET=japanese; elif [ x`echo $LANG | cut -b 1-2` = x"ko" ]; then export JLESSCHARSET=ko; fi ==> /etc/profile.d/mc.sh <== mc () { mkdir -p $HOME/.mc/tmp 2> /dev/null chmod 700 $HOME/.mc/tmp MC=$HOME/.mc/tmp/mc-$$ /usr/bin/mc -P "$@" > "$MC" cd "`cat $MC`" /bin/rm -f "$MC" unset MC; } ==> /etc/profile.d/qt.sh <== # Qt initialization script (sh) if [ -z "$QTDIR" ] ; then QTDIR="/usr/lib/qt3-gcc2.96" fi export QTDIR ==> /etc/profile.d/vim.sh <== if echo $SHELL |grep bash 2>&1 >/dev/null; then # aliases are bash only alias vi=vim fi ==> /etc/profile.d/which-2.sh <== # Initialization script for bash and sh # export AFS, if you are in AFS environment alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde' Some of those are standard Red Hat, some are mine. It's a convenience for administrators and developers alike. I wrote bash.sh because I want that to be the way _my_ site operates. I fret that IBM doesn't have one for Java to its environment variables correctly. A site might one for Java so as to set CLASSPATH to point to site-wide Java classes. Feel free to cite this to push your argument. -- Cheers John Summerfield ----- End forwarded message -----
Attachment:
signature.asc
Description: Digital signature