Use echo statements.
Run bash -n script to check for syntax errors.
Use the command set -v to get a verbose dump of each line the shell reads. Use set +v to turn off verbose mode.
Use the command set -x to see what each command expands to. Again, set +x turns this mode off.
.forward(mail file)
.bashrc(My bash login config file)
.bash_logout(My bash logout config file)
.aliases(command mapping file)
.vimrc(vim text editor config file)
.gvimrc(vim X/gui config file)
man diff
man sdiff
man indent
man wget
"|IFS=' ' && exec /opt/bin/procmail -f || exit 75 #johnston" # To forward mail during holidays, etc type a line with the address # you want to forward mail to. To disable it you can just comment it out # with a #. I use # for a comment line and ## for a disabled command line. # PS you could always telnet to borg and remotely edit this file anyway. # forwards mail and leaves a copy on this server ##\johnston, me@hotmail.com
# (.bashrc)
# $Id: .bashrc,v 1.6 2003/08/07 15:40:14 johnston Exp johnston $
#
# bash web manual : http://www.gnu.org/manual/bash-2.05a/
#
# This file sets the behaviour for the shell bash.
# If commands exist in a .bash_profile or .bash_login, it is recommended
# that they be moved into this file according to the conventions used below.
#
if [ "$PS1" = "" ] # is shell interactive?
then
interactive=0
else
interactive=1
fi
# setup subshells
# (including login shell)
#
# set default terminal types
#
# Set default network, dialup, switch, and unknown terminal types.
network_term=vt100
dialup_term=vt100
switch_term=vt100
unknown_term=dumb
#
# setup system variables
#
# Do not remove the following line; doing so may cause some programs
# to fail.
if [ -r /etc/shinit/bashrc ]
then
. /etc/shinit/bashrc
fi
#
# setup shell variables
#
# Set the size of the history list.
HISTSIZE=20
# * Change prompt to display directory and NL
PS1="\h:\w\n\\$ "
#
# setup shell session
#
# Limit size of core files.
##ulimit -S -c 0
#
# setup aliases
#
if [ -f $HOME/.aliases ] && grep "=" $HOME/.aliases > /dev/null
then
. $HOME/.aliases
fi
#
# setup functions
#
if [ -f $HOME/.functions ]
then
. $HOME/.functions
fi
case $SHLVL in
1) # setup login shell
#
# setup environment
#
if [ -f $HOME/.environment ]
then
. $HOME/.environment
fi
##EDITOR="/usr/bin/vi"
EDITOR="/opt/bin/vim -X"
EXINIT="set autoindent shell=/bin/bash noterse"
MORE="-s"
export EDITOR EXINIT MORE
CVSROOT="$HOME/CVSROOT"
export CVSROOT
TEXINPUTS=.:$HOME/lib/latex/tex/latex//:/opt/TeX/texmf/tex/latex//:
export TEXINPUTS
BSTINPUTS=.:$HOME/lib/latex/tex/bibtex//:/opt/TeX/texmf/bibtex/bst//:
export BSTINPUTS
BIBINPUTS=.:$HOME/lib/latex/tex/bibtex//:/opt/TeX/texmf/bibtex/bib//:
export BIBINPUTS
MANPATH=$MANPATH:/opt/TeX/man:$HOME/man
export MANPATH
#
# setup login shell variables
#
# Ingore eof. Type logout/exit to leave the shell.
IGNOREEOF=
# Do not remove the $SYSPATH entry from the PATH variable; doing so
# may cause some programs to fail.
PATH="$HOME/bin:$SYSPATH:/pub/bin:."
export PATH
# Change pager to less
PAGER="less -I"
export PAGER
LW="learnctr-lw"
export LW
#
# setup packages
#
export JAVA_SERVLET_TYPE=tomcat
PACKAGES="$SYSPKG"
setup_packages
#
# setup login session
#
if [ $interactive -eq 1 ]
then
# Set terminal type.
ts
# Enable ^Z option.
stty susp ^Z
## stty erase ^H
# Allow messages from other users. Be informed of new mail.
mesg y ; biff y
# Check for news.
##rn -c -s || echo There is news.
# Show how long the system has been up.
uptime
echo
date
echo
## check for new mail
nfrm
fi
#show my self-reminders on login
if [ -f $HOME/.to_do ]
then
echo ""
echo "Things to do:"
cat $HOME/.to_do
echo ""
fi
;;
esac
#(.bash_logout)
# write logout time to log file
if [ -f ~/.lout ]
then
date >> ~/.lout
echo " Bye-Bye Geoffrey" >> ~/.lout
fi
alias e='cd cs2110/a4_SortMerge; vi SortMerge.java' alias c='clear; javac -g TestSortMerge.java' alias r='clear; java TestSortMerge inputData' alias ?='nfrm' alias calendar='/usr/dt/bin/dtcm' alias distill='/opt/Acrobat3/bin/distilld' alias f='who | fgrep hlfx57' alias gcc='gcc -std=c99 -Wall -pedantic' alias gmake='clear;gmake' alias home='netscape http://www.cs.dal.ca/~johnston/index.html &' alias i='echo $SSH_CLIENT' alias indent='indent -bli0 -i3' alias j='jobs' alias jindent='java -classpath $CLASSPATH:$HOME/lib/java/Jindent/Jindent.jar:. Jindent -p $HOME/lib/java/Jindent/Dal.jin -fr' alias junits='java -classpath $CLASSPATH:$HOME/lib/java/junit3.8.1/junit.jar:. junit.swingui.TestRunner' alias junitt='java -classpath $CLASSPATH:$HOME/lib/java/junit3.8.1/junit.jar:. junit.textui.TestRunner' alias l='/usr/bin/ls -al|less' # using a linux ls in my bin 'cos I like colour alias ls='~/bin/ls -p --color' alias m='wnewmail -i 150' alias nl='nl -ba' alias o='who | sort | less' alias p='pine -i' alias q='lwq -Punix-lab ; lwq -Pmaclab-lw ; lwq -Plc' alias s='$HOME/bin/slirp -P -b 115200' alias ss='screen' alias t='cat ~/.plan' alias u='du -k |sort -n' alias v='/usr/ucb/printenv |less' alias vi='vim -X' alias w='cat /var/log/apache/access_log | fgrep johnston | fgrep html' alias ww='w|wc -l' alias www='cat /opt/apache-1.3.27/logs/referer_log |grep johnston | more'
" Based on Bram Moolenaar's version " This must be first, because it changes other options as a side effect. set nocompatible "set backspace=indent,eol,start " backspacing over everything in insert set bs=2 " allow backspacing over everything in insert mode set noautoindent " always set autoindenting off set nobackup " do not keep a backup file, use versions instead set nowrap " don't wrap lines "behave xterm set selectmode=mouse set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set noerrorbells " errorbells: damn this beep! ;-) set noignorecase " ignore the case in search patterns? NO! set showmatch " Show the matching bracket for the last ')'? set showmode " Show the current mode? YEEEEEEEEESSSSSSSSSSS! set showcmd " display incomplete commands set incsearch " do incremental searching set laststatus=2 " Always display a status line at the bottom of window. "set expandtab " expand tabs to spaces "set mouse=a " At the beginning of a line, take 'shiftwidth' spaces, else 'tabstop' spaces set smarttab "colours in xterm " Farben im xterm " map:se t_Co=16 :se t_AB= [%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm :se t_AF= [%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm " Only do this part when compiled with support for autocommands. if has("autocmd") " Enable file type detection. " Use the default filetype settings, so that mail gets 'tw' set to 72, " 'cindent' is on in C files, etc. " Also load indent files, to automatically do language-dependent indenting. filetype plugin indent on " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif endif " has("autocmd") "abBREVIATIONS "================================================================== " typos iab anf and iab adn and iab ans and iab johsnton johnston iab teh the iab thre there " abbreviations & acronyms iab bcs Bachelor of Computer Science Degree iab gweb http://www.cs.dal.ca/~johnston/ iab Yruler * * * * 1 * * * * 2 * * * * 3 * * * * 4 * * * * 5 * * * * 6 * *_* * 7 * * * * 8 iab rg regards, Geoff iab psvm public static void main(String[] args) { iab sop System.out.println(" iab sopd if (DEBUG) System.out.println("DEBUG " + iab #d #define iab #i #include iab #l ----------------------------------------------------------------- iab #b /**************************************************************** iab #e ****************************************************************/ iab su regards, Geoff -- "I've had a wonderful time, but this wasn't it." - Groucho Marx (1895-1977) " Enable automatic color syntax highlighting on startup " Set the colours for vim on "xterm" " if &term=="xterm" set t_Co=16 set t_AB=[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm set t_AF=[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm " endif syn on " =================================================================== " ASCII tables - you may need them some day. Save them to a file! " =================================================================== " " ASCII Table - | octal value - name/char | " " |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| " |010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | " |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| " |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | " |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | " |050 ( |051 ) |052 * |053 + |054 , |055 - |056 . |057 / | " |060 0 |061 1 |062 2 |063 3 |064 4 |065 5 |066 6 |067 7 | " |070 8 |071 9 |072 : |073 ; |074 < |075 = |076 > |077 ? | " |100 @ |101 A |102 B |103 C |104 D |105 E |106 F |107 G | " |110 H |111 I |112 J |113 K |114 L |115 M |116 N |117 O | " |120 P |121 Q |122 R |123 S |124 T |125 U |126 V |127 W | " |130 X |131 Y |132 Z |133 [ |134 \ |135 ] |136 ^ |137 _ | " |140 ` |141 a |142 b |143 c |144 d |145 e |146 f |147 g | " |150 h |151 i |152 j |153 k |154 l |155 m |156 n |157 o | " |160 p |161 q |162 r |163 s |164 t |165 u |166 v |167 w | " |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| " " =================================================================== " ASCII Table - | decimal value - name/char | " " |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| " |008 bs |009 ht |010 nl |011 vt |012 np |013 cr |014 so |015 si | " |016 dle|017 dc1|018 dc2|019 dc3|020 dc4|021 nak|022 syn|023 etb| " |024 can|025 em |026 sub|027 esc|028 fs |029 gs |030 rs |031 us | " |032 sp |033 ! |034 " |035 # |036 $ |037 % |038 & |039 ' | " |040 ( |041 ) |042 * |043 + |044 , |045 - |046 . |047 / | " |048 0 |049 1 |050 2 |051 3 |052 4 |053 5 |054 6 |055 7 | " |056 8 |057 9 |058 : |059 ; |060 < |061 = |062 > |063 ? | " |064 @ |065 A |066 B |067 C |068 D |069 E |070 F |071 G | " |072 H |073 I |074 J |075 K |076 L |077 M |078 N |079 O | " |080 P |081 Q |082 R |083 S |084 T |085 U |086 V |087 W | " |088 X |089 Y |090 Z |091 [ |092 \ |093 ] |094 ^ |095 _ | " |096 ` |097 a |098 b |099 c |100 d |101 e |102 f |103 g | " |104 h |105 i |106 j |107 k |108 l |109 m |110 n |111 o | " |112 p |113 q |114 r |115 s |116 t |117 u |118 v |119 w | " |120 x |121 y |122 z |123 { |124 | |125 } |126 ~ |127 del| " " =================================================================== " ASCII Table - | hex value - name/char | " " | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| " | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | " | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| " | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | " | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | " | 28 ( | 29 ) | 2a * | 2b + | 2c , | 2d - | 2e . | 2f / | " | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | " | 38 8 | 39 9 | 3a : | 3b ; | 3c < | 3d = | 3e > | 3f ? | " | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | " | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | " | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | " | 58 X | 59 Y | 5a Z | 5b [ | 5c \ | 5d ] | 5e ^ | 5f _ | " | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | " | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | " | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | " | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| " =================================================================== " Yet another example for an autocommand: [980616] " au VimLeave * echo "Thanks for using Vim"version". --Sven Guckes@vim.org!" " =================================================================== " Last but not least... " ===================================================== " The last line is allowed to be a "modeline" with my setup. " It gives vim commands for setting variable values that are " specific for editing this file. Used mostly for setting " the textwidth (tw) and the "shiftwidth" (sw). " Note that the colon within the value of "comments" needs to " be escaped with a backslash! (Thanks, Thomas!) " vim:tw=70 et sw=4 comments=\:\" "------------------------------------------------------------- ""useful stuff " to remove the ^M from MS-Dos files " :1,$s/{Ctrl+V}{Ctrl+M}//{Enter}
" Based on Bram Moolenaar's version " Make external commands work through a pipe instead of a pseudo-tty "set noguipty " set the X11 font to use set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 " Make command line two lines high set ch=2 " Make shift-insert work like in Xterm mapLast updated on 15 Aug 2003map! " I like highlighting strings inside C comments let c_comment_strings=1 colors murphy " Switch on syntax highlighting. syntax on " Switch on search pattern highlighting. set hlsearch " Do incremental searching. set incsearch " Set ignorecase on. set ignorecase " Hide the mouse pointer while typing set mousehide " Turn off Xim server (support for foreign character sets) set imdisable " Set nice colors " background for normal text is light grey90 " Text below the last line is darker grey " Cursor is green " Constants are not underlined but have a slightly lighter background highlight Normal guibg=lightyellow highlight Cursor guibg=Green guifg=NONE " turned off by me highlight NonText guibg=grey80 highlight Constant gui=NONE guibg=grey95 highlight Special gui=NONE guibg=grey95 set background=dark