Re: ? .bashrc and .bash_profile and PATH
On Fri, Jan 04, 2002 at 04:13:10PM -0800, Paul E Condon wrote:
> Where are the examples? Where is other docs about user space
> initialization?
Here is mine:
# ~/.bashrc: executed by bash(1) for non-login shells.
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
PS1="[\u@\h:\w]\$ "
set -o vi
#export LANG=en_US.ISO8859-1
# because i can't type
alias cdc="cd"
alias cdd="cd"
alias cls="clear"
alias dir="ls -l | less"
alias dos="dosemu -home"
alias atrm="aterm --background \#4682b4 -fn
-misc-fixed-medium-r-normal--20-200
-75-75-c-100-iso8859-1 -title $HOSTNAME -geometry 80x25 &"
alias atrmtr="aterm -tr -fn
-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8
859-1 -title $HOSTNAME -geometry 80x30 &"
alias xt="xterm -fn -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1 -title $HOSTNAME -geometry 80x30 &"
alias cb="~/pycheckbook/PyCheckbook.py ~/pycheckbook/wells-fargo.qif &"
alias weblog="tail -f /var/log/apache/access.log"
# .....
Under Debian, you can also tweak /etc/profile and /etc/bashrc to make
global changes for all users (you must be root to do this)
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:~/bin:/usr/games"
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
export PATH PS1
umask 022
# ...................
You can also find good info on bash in the bash-prompt how-to and
bash-programming how-to at http://linuxdocs.org (and other mirrors)
There is a difference between 'login shells' and non-interactive shell
environments, which may or may not be an issue ... non-interactive
environments are passed to: bash invocations from scripts and x-term
type shells launched on your desktop once you are logged in.
When you are playing with these files, the command 'source' as in:
source ~/.bashrc
is handy ... causes the file to be read and run just as if you had logged
out and back in ...
aloha,
dave
Reply to: