[ale] Weird stuff in my environment

Jeff Dilcher dilcher at cueva.com
Tue Jun 15 20:59:27 EDT 1999


I used the "set" command, to check an evironment variable,
and had some weird stuff tacked on the end that I have never
seen before.  Can anyone tell me what it is, and why it is
part of my environment?  Things appear to start getting
weird after the USERNAME:

On a related note (and why I was checking this to begin with),
what is the best way to set the default editor to pico in
RedHat linux 6.0?

Thanks much!!!
Jeff



ASH=/bin/bash
BASH_VERSION=1.14.7(1)
COLUMNS=80
ENV=/root/.bashrc
EUID=0
HISTFILE=/root/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
HOME=/root
HOSTNAME=server.cueva.penguinpowered.com
HOSTTYPE=i386
IFS=

INPUTRC=/etc/inputrc
LINES=25
LOGNAME=root
MAIL=/var/qmail/alias/Mailbox
MAILCHECK=60
MAILDROP=/var/qmail/alias/Mailbox
OPTERR=1
OPTIND=1
OSTYPE=Linux
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/var/
qmail/bin:/usr/local/sbin:/root/bin
PPID=546
PS1=[\u@\h \W]\$
PS2=>
PS4=+
PWD=/root
SHELL=/bin/bash
SHLVL=1
TERM=linux
UID=0
USER=root
USERNAME=root
_=more
j=/usr/local/sbin
oldvalue=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/
var/qmail/bin
pathcomponent=/usr/local/sbin
pathlikevar=PATH
app_one=()
{ 
    pathlikevar=$1;
    pathcomponent=$2;
    oldvalue=$(eval echo \$$pathlikevar);
    case $pathcomponent in 
        "/")
            echo 'pathcomponent cannot be "/"'
        ;;
        ":")
            export $pathlikevar=$oldvalue:
        ;;
        "")
            echo 'pathcomponent cannot be ""'
        ;;
        *)
            pathcomponent=$(echo $pathcomponent| sed 's/://g');
            if [ "$pathcomponent" = "" ]; then
                echo "pathcomponent cannot have more than one :";
            else
                case $oldvalue in 
                    "")
                        export $pathlikevar=$pathcomponent
                    ;;
                    *)
                        function check_endline () 
                        { 
                            echo "$pathcomponent\$" >~/.pathcomponent.endline;
                            echo $oldvalue | grep -f ~/.pathcomponent.endline
                        };
                        function check_colon () 
                        { 
                            echo "$pathcomponent:" >~/.pathcomponent.colon;
                            echo $oldvalue | grep -f ~/.pathcomponent.colon
                        };
                        if [ "$(check_endline)" = "" ] && [ "$(check_colon)" = "" ]; then
                            export $pathlikevar=$oldvalue:$pathcomponent;
                        fi;
                        rm -f ~/.pathcomponent.colon ~/.pathcomponent.endline
                    ;;
                esac;
            fi
        ;;
    esac
}
appath=() 
{ 
    if [ "$#" -eq 0 ]; then
        echo "Usage: pathlikevar pathcomponent1 [pathcomponent2 ...]";
        exit 1;
    fi;
    pathlikevar=$1;
    shift;
    for j in $@;
    do
        app_one $pathlikevar $j;
    done
}
check_colon=() 
{ 
    echo "$pathcomponent:" >~/.pathcomponent.colon;
    echo $oldvalue | grep -f ~/.pathcomponent.colon
}
check_endline=() 
{ 
    echo "$pathcomponent\$" >~/.pathcomponent.endline;
    echo $oldvalue | grep -f ~/.pathcomponent.endline
}
mc=() 
{ 
    MC=/tmp/mc$$-"$RANDOM";
    /usr/bin/mc -P "$@" >"$MC";
    cd "`cat $MC`";
    rm "$MC";
    unset MC
}






More information about the Ale mailing list