[SLUG] .bashrc, .bash_profile, .etc...

From: bill triplett (btt@nethouse.com)
Date: Sat Sep 15 2001 - 19:57:04 EDT


Hi,

With all this talk of bashrc's and bash_profile...

What's in your .bashrc or .bash_profile or .profile or whatever
shell initialization files you use? I would really like to know.

Here is a prompt command I've been working on (with help from the
bash prompt how-to):

PS1="[\[\033[0;32m\]\$(date +%H:%M:%S)\[\033[0m\]][\[\033[1;35m\]\$(cat $MAIL|grep -c ^Message)\[\033[0m\]][\[\033[0;31m\]\$OLDPWD\[\033[0m\]]\n[\[\033[1;31m\]\u@\h:\w\[\033[0m\]]\$ "

... the mail grepper will give bad results if there is a rejected
message waiting, but otherwise it works well. I like knowing what
$OLDPWD (the previous working directory) is for easy 'cd -'ing.

and something in .bash_profile to start ssh-agent:

if [ "$SHLVL" = "1" ] && [ "x$SSH_AGENT_PID" = "x" ]; then
        echo -n "Start ssh-agent? " ; read SA
        if [ "$SA" = "y" ]; then
                eval `ssh-agent`
                ssh-add /home/billt/.ssh/id_dsa
        fi
fi

...and in .bash_logout to end it:

if [ "x$SSH_AGENT_PID" != "x" ]; then
        eval `ssh-agent -k`
fi

Cheers,
Bill



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:23:33 EDT