Imported from ../bash-2.04.tar.gz.

This commit is contained in:
Jari Aalto 2000-03-17 21:46:59 +00:00
commit bb70624e96
387 changed files with 28522 additions and 9334 deletions

View file

@ -0,0 +1,24 @@
This directory contains some useful bash files.
In order to use this configuration:
echo "source ~/.bashrc" > ~/.profile
echo "source /usr/share/init/bash/rc" > ~/.bashrc
echo "source /usr/share/init/bash/login" > ~/.login
In order to customize this setup:
mkdir ~/Library/init/bash
and create the following files there as necessary:
aliases.mine - shell aliases
completions.mine - completions
environment.mine - environment
rc.mine - run commands
path - command search path
See the corresponding file in /usr/share/init/bash for more information about the role of each file. You can easily extend or override the configuration provided by the default file. For example, you can add more aliases by adding the appropriate commands in aliases.mine.
-Fred
tritan@mit.edu

View file

@ -0,0 +1,34 @@
##
# Bash aliases file
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
##
##
# Aliases
##
alias .='cwd'
alias ..='cd ..'
alias cd..='cd ..'
alias cdwd='cd $(/bin/pwd)'
alias cwd='echo $PWD'
alias l='ls -lg'
##
# Functions
##
files () { find ${1} -type f -print ; }
ff () { find . -name ${1} -print ; }
ll () { ls -lag "$@" | more ; }
word () { fgrep -i "$*" /usr/dict/web2 ; }
wordcount () { cat "${1}" | tr -s ' .,;:?\!()[]"' '\012' | \
cat -n | tail -1 | awk '{print $1}' ; }
##
# Read user's aliases
##
if [ -r ${bash_initdir}/aliases.mine ]; then
source ${bash_initdir}/aliases.mine
fi

View file

@ -0,0 +1,22 @@
##
# Bash
# User preferences file
# Override these in rc.mine
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
# July 09, 1992
#
# MIT Project Athena
##
if [ -n "$PS1" ]; then
# Prompts
PS1='[\h:\w] \u\$ '
PS2=' -> '
#PS3=
#PS4=
set -o emacs
fi

View file

@ -0,0 +1,24 @@
##
# Bourne Again Shell environment file
# Global environment setup
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
# July 09, 1992
#
# MIT Project Athena
#
# ORIGINAL SOURCES: /usr/athena/lib/init/cshrc (ATHENA REL 7.3P)
##
export ENV_SET="YES" # avoid repeat
# File creation mask
umask 022 # all files created are -rw-r--r--
##
# Load user environment
##
if [ -f ${bash_initdir}/environment.mine ]; then
source ${bash_initdir}/environment.mine
fi

View file

@ -0,0 +1,15 @@
##
# Set path
##
export PATH="${HOME}/${MACHTYPE}/bin:${HOME}/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export MANPATH="${HOME}/man:/usr/local/share/man:/usr/share/man"
##
# Read user's login
##
if (-r ${bash_initdir}/login.mine) then
source ${bash_initdir}/login.mine
fi

View file

@ -0,0 +1,10 @@
##
# Destroy credentials
##
if [ -z "${TERM_PROGRAM}" ]; then
# Don't run these commands if the shell is launched by Terminal,
# even if it's a login shell.
if klist -s; then kdestroy; fi
fi

View file

@ -0,0 +1,63 @@
##
# Bourne Again Shell config file
#
# Wilfredo Sanchez Jr. | tritan@mit.edu
# July 09, 1992
#
# MIT Project Athena
#
# ORIGINAL SOURCES: /usr/athena/lib/init/cshrc (ATHENA REL 7.3P)
##
default_initdir=/usr/share/init
default_bash_initdir=${default_initdir}/bash
user_initdir=~/Library/init
user_bash_initdir=${user_initdir}/bash
if [ -r ${user_bash_initdir} ]; then
initdir=${user_initdir}
bash_initdir=${user_bash_initdir}
else
initdir=${default_initdir}
bash_initdir=${default_bash_initdir}
fi
# SET UP HOST-DEPENDANT VARIABLES, ETC.
host=$(echo $(hostname) | tr A-Z a-z)
user=`whoami`
export HOST=${host}
export USER=${user}
# User ID
if [ -z "${uid}" ]; then uid=$(id | cut -d = -f 2 | cut -d \( -f 1); fi
# SET COMMAND SEARCH PATH AND MAN PATH
if [ -f ${bash_initdir}/path ]; then source ${bash_initdir}/path; fi
# ENVIRONMENT SETUP
if [ -n "${PS1}" ]; then interactive="YES"; fi
if [ -z "${ENV_SET}" ]; then
if [ -f ${default_bash_initdir}/environment ]; then
#echo "Initializing environment..."
source ${default_bash_initdir}/environment
fi
fi
if [ -r ${default_bash_initdir}/bash.defaults ]; then
source ${default_bash_initdir}/bash.defaults
fi
# DEFAULT LOGIN SOURCES
if [ -f ${bash_initdir}/rc.mine ]; then source ${bash_initdir}/rc.mine; fi
if [ "${interactive}" = "YES" ]; then
# These aren't useful for non-interactive sessions
if [ -f ${default_bash_initdir}/aliases ]; then
source ${default_bash_initdir}/aliases
fi
fi