Ode to the Shell (Was: Re: which file manager you use?)
Charles Howse
chowse at charter.net
Thu Feb 5 23:18:15 UTC 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 05 February 2004 05:03 pm, Richard Welty wrote:
> On Thu, 5 Feb 2004 15:59:39 -0600 Charles Howse <chowse at charter.net> wrote:
> > > Actually, the shell was one the main reasons for me to switch to Linux.
> >
> > In what file are the default aliases kept?
>
> depends on what shell you're using. i'll take a flyer and guess that
> it's bash (the most likely shell for the modern linux user). for bash,
> system wide aliases are generally in /etc/bashrc and per-user
> aliases are in ~/.bashrc
Yep, using bash, but I don't see 'em.
[charles at moe charles]$ echo $SHELL
/bin/bash
[charles at moe charles]$ alias
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot
- --show-tilde'
My ~/.bashrc
# .bashrc
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
My /etc/bashrc
# /etc/bashrc
# System wide functions and aliases
# Environment stuff goes in /etc/profile
# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
umask 002
else
umask 022
fi
# are we an interactive shell?
if [ "$PS1" ]; then
if [ -x /usr/bin/tput ]; then
if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb"
terminal
stty erase `tput kbs`
elif [ -x /usr/bin/wc ]; then
if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb"
terminal
stty erase `tput kbs`
fi
fi
fi
case $TERM in
xterm*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
else
PROMPT_COMMAND='echo -ne
"\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
fi
;;
screen)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='echo -ne
"\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] &&
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
# Turn on checkwinsize
shopt -s checkwinsize
[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
fi
fi
# vim:ts=4:sw=4
- --
Charles Howse
Jackson, TN
Fedora Core 1 Uptime: 6:12
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAIs83/S+VsB9RMKgRAiYSAJ9pICTbThxoZ6FpSvXErjf6+/YNEACggy0y
WtAFHNnW4Qq0pWITRzoEh6U=
=BReB
-----END PGP SIGNATURE-----
More information about the fedora-list
mailing list