commit bash-20130301 snapshot

This commit is contained in:
Chet Ramey
2013-03-26 20:51:22 -04:00
parent 8eb22ee966
commit c7e43312f9
220 changed files with 45368 additions and 801 deletions
-9
View File
@@ -10,12 +10,3 @@ bash-profile Sample startup file for bash login shells (Ramey).
bashrc Sample Bourne Again SHell init file (Ramey).
Bashrc.bfox Sample Bourne Again SHell init file (Fox).
README README
apple Example Start-up files for Mac OS X.
apple/aliases Sample aliases for Mac OS X.
apple/bash.defaults Sample User preferences file.
apple/environment Sample Bourne Again Shell environment file.
apple/login Sample login wrapper.
apple/logout Sample logout wrapper.
apple/rc Sample Bourne Again Shell config file.
apple/README README
+21
View File
@@ -0,0 +1,21 @@
Some sample startup files. The ones starting with capital letters
are originally from Brian Fox. The ones starting with lowercase
letters are from Chet Ramey.
They will require changes for your environment.
Bash_aliases Some useful aliases (Fox).
Bash_profile Sample startup file for bash login shells (Fox).
bash-profile Sample startup file for bash login shells (Ramey).
bashrc Sample Bourne Again SHell init file (Ramey).
Bashrc.bfox Sample Bourne Again SHell init file (Fox).
README README
apple Example Start-up files for Mac OS X.
apple/aliases Sample aliases for Mac OS X.
apple/bash.defaults Sample User preferences file.
apple/environment Sample Bourne Again Shell environment file.
apple/login Sample login wrapper.
apple/logout Sample logout wrapper.
apple/rc Sample Bourne Again Shell config file.
apple/README README
+33
View File
@@ -0,0 +1,33 @@
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
aliases Sample aliases for Mac OS X.
bash.defaults Sample User preferences file.
environment Sample Bourne Again Shell environment file.
login Sample login wrapper.
logout Sample logout wrapper.
rc Sample Bourne Again Shell config file.
README README
+34
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' | \
awk 'END {print NR}' ; }
##
# Read user's aliases
##
if [ -r ${bash_initdir}/aliases.mine ]; then
source ${bash_initdir}/aliases.mine
fi
@@ -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
+24
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
+15
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
+10
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
+63
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