My Shell Setup Suite

John Hurst

Version 1.9.7

20240402:091059

Abstract

This document defines and describes the suite of programs used to create my shell working environment on the range of machines that I use.

Table of Contents

1 Introduction
1.1 Active Machines
1.2 Inactive Machines
1.3 Decomissioned Machines
2 Literate Data
3 The Profile file .bash profile
3.1 Who are we?
3.2 Where are we?
3.3 Set Environment Variables
3.3.1 Set the PATH variable
3.4 Set the PYTHONPATH
3.5 Set Background Colour
4 The Set Machine file
5 The Bash Resource Control file .bashrc
5.1 Define aliases
5.2 Define the shell prompt
5.3 Determine if Primary Login
5.4 The bash-prompt file
6 .texrc The TeX Resource Control file
7 .sgmlrc The SGML Resource Control file
8 Logging out: The bash logout file
9 Window Colours
9.1 Obsolete Machines
10 The Makefile
11 Default .bashrc
12 Indices
12.1 Files
12.2 Chunks
12.3 Identifiers
13 Document History


1. Introduction

This document describes the files used to set up the appropriate working environment for using the bash shell. They are intensely personal, and anyone reusing this document for their own purposes will also certainly want to modify this document.

Permission is given to reuse this document, provided that the source is acknowledged, and that any changes are noted in the documentation.

The document is in the form of a literate program, and generates all files necessary to maintain the working environment, including a Makefile.

These files have been edited from equivalent tcsh originals, but not all features of that shell have been mirrored in here.

1.1 Active Machines

These machines are maintained in active use.

1.2 Inactive Machines

Mostly operational, but turned off.

1.3 Decomissioned Machines

These machines do not have any future.

2. Literate Data

This message gets used in a number of places to ensure that all modifications are focussed through this document.

<edit warning 2.1> =
DO NOT EDIT this file! see $HOME/Computers/Sources/Setup/setup.xlp instead
Chunk referenced in 3.1 5.1 5.10 6.1

3. The Profile file .bash profile

The .bash_profile file is executed automatically by login shells. It has the responsibility to set the path (and other variables), run the .bashrc file (because a login shell doesn't do that automatically), and initialize the prompt with an explicit call to bash-prompt. I also worry about the initial login shell, since that has to do slightly different things (such as setting window title bars, and clearing up when logging out).

".bash_profile" 3.1 =
#<edit warning 2.1> # version=<current version 12.1>, <current date 12.2> #echo "start .bash_profile" <determine time zone 3.2> <determine who we are 3.3> <determine where we are 3.4,3.5,3.6> stty kill ^U erase ^? intr ^C <bash: set variables 3.8> source $HOME/.bashrc if [ $SHLVL -gt 0 ] ; then $HOME/bin/bash-prompt fi #echo "end .bash_profile"
<determine time zone 3.2> =
TZ='Australia/Melbourne' #TZ='America/Seattle' # -7/-6 #TZ='America/Anchorage' # -8 #TZ='Pacific/Honolulu' # -9 #TZ='Pacific/Rarotonga' # -10 #TZ='Pacific/Samoa' # -11 #TZ='Pacific/Tonga' # +13 #TZ='Pacific/Fiji' # +12 #TZ='Pacific/Noumea' # +11 #TZ='Pacific/Auckland' # +12/+13 #TZ='Australia/Brisbane' # +10 #TZ='Asia/Bangkok' # +7 export TZ
Chunk referenced in 3.1 5.1

3.1 Who are we?

(pedantic note: one might be tempted to change that title to "Whom are we?", but note that the verb "to be" is copulative, meaning that it takes the nominative case for both subject and predicate.)

<determine who we are 3.3> =
if [ -x /usr/bin/whoami ] ; then user=`/usr/bin/whoami` elif [ -x /usr/local/bin/whoami ] ; then user=`/usr/local/bin/whoami` else echo "$0: Unable to determine username, no /usr/bin/whoami" fi
Chunk referenced in 3.1

We often need to know in this script whether we are logging in as ajh or as root. This code chunk sets the global variable $user appropriately, or complains.

3.2 Where are we?

<determine where we are 3.4> =
if [ -x /bin/hostname ] ; then HOSTNAME=`/bin/hostname` else echo "$0: Unable to determine machine name, no /bin/hostname" fi export HOSTNAME
Chunk referenced in 3.1 5.1
Chunk defined in 3.4,3.5,3.6

Crucial to the whole rigmarole of setting things up is knowing on what machine we are running. hostname is our friend here. If there is no hostname, then we are in deep do-dos.

<determine where we are 3.5> =
EXPR=`/usr/bin/which expr`
Chunk referenced in 3.1 5.1
Chunk defined in 3.4,3.5,3.6

For some strange reason, the expr program resides in a different place on Ubuntu systems. Find the right one.

<determine where we are 3.6> =
HOST=`hostname -s` export HOST
Chunk referenced in 3.1 5.1
Chunk defined in 3.4,3.5,3.6

The upshot is to set HOST as an abbreviated form of HOSTNAME, that is, without any domain qualification. Do this by extracting the prefix of ".". Note the new version of this, using the -s flag to hostname. It pays to read the manual! The old version follows, commented out.

<determine where we are - expr 3.7> =
HOST=`$EXPR $HOSTNAME : '\([^.]*\)'` export HOST

3.3 Set Environment Variables

The variables that we set are

ASSOCDB
Defines the absolute pathname to the assoc program's database file. It is currently set to /home/ajh/assoc/files, and set in <set sundry environment variables >.
HEADING
Filename to record what is displayed at the head line of the window. This is modified by process number to ensure that each window is handled independently. See scrap <set heading 5.11>.
HOST
The leading word (non-`.' characters) of the full hostname. For example, if HOSTNAME gives central.cs.monash.edu.au, return just central. See scrap <determine where we are 3.4,3.5,3.6>.
MANPATH
The search path for man pages.
PATH
The search path for commands and binaries. See scrap <set paths on all machines 3.9,3.24>.
RSYNC_RSH
The rsh protocol to be used by rsync, currently set to ssh, and set in <set sundry environment variables 3.27>.
SERVER
The name of the server machine.
BGCOLOUR
The background colour for this machine (see section Window Colours)
PYTHONPATH
The path to search for Python libraries.
ALBENS
The qualified domain name to reach albens from the current platform.
ALBURY
The qualified domain name to reach albury from the current platform. This currently does not work outside wodonga.
BITTERN
The qualified domain name to reach bittern from the current platform.
BURNLEY
The qualified domain name to reach burnley from the current platform.
EVERTON
The qualified domain name to reach everton from the current platform.
GWUC-WIKI
The qualified domain name to reach gwuc-wiki from the current platform.
KERANG
The qualified domain name to reach kerang from the current platform.
REUILLY
The qualified domain name to reach reuilly from the current platform.
JEPARIT
The qualified domain name to reach jeparit from the current platform.
SPENCER
The qualified domain name to reach spencer from the current platform.
TERANG
The qualified domain name to reach terang from the current platform.
WODONGA
The qualified domain name to reach wodonga from the current platform.
<bash: set variables 3.8> =
<set sundry environment variables 3.27> <set paths on all machines 3.9,3.24> if [ $SHLVL -le 1 ] ; then <do root related login things here 3.25> else <do non-root related login things here 3.26> fi if [ -f $HOME/.texrc ] ; then source $HOME/.texrc else echo "No .texrc file - I hope that is OK?" fi if [ -f $HOME/.set_colours.sh ] ; then source $HOME/.set_colours.sh else echo "No .set_colours.sh file - I hope that is OK?" fi
Chunk referenced in 3.1

The sundry variables are set first, since some of them may be used to set the path variable.

3.3.1 Set the PATH variable

Note that the paths are established in increasing order of precedence, that is, the last paths defined are found first.

The machines bittern, dimboola, are all set in like fashion, as they all run Mac OS X.

<set paths on all machines 3.9> =
PATH="/bin" # base path case $HOST in albens* ) <set path for albens 3.10> ;; albury* ) <set common path for Linux systems 3.22> ;; bittern* ) <set path for bittern 3.11> ;; burnley* ) <set path for burnley 3.14> ;; everton* ) <set path for everton 3.15> ;; gwuc-wiki* | gwuc-wiki.gwuc.org.au* ) <set path for gwuc-wiki 3.20> ;; jeparit* ) <set common path for Linux systems 3.22> ;; kerang* ) <set common path for Linux systems 3.22> export SLOTS=/sys/devices/bone_capemgr.9/slots export PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins ;; newport* ) <set path for newport 3.17> ;; reuilly* ) <set common path for Linux systems 3.22> ;; spencer* ) <set path for spencer 3.19> ;; terang* ) <set common path for Linux systems 3.22> ;; wodonga* ) <set common path for MacOSX systems 3.21> ;; *) echo "$0: Using defaults to set path for $HOST" <set path for defaults 3.23> ;; esac export PATH
Chunk referenced in 3.8
Chunk defined in 3.9,3.24
<set path for albens 3.10> =
stty erase ^H <set common path for Linux systems 3.22>
Chunk referenced in 3.9
<set path for bittern 3.11> =
<set common path for MacOSX systems 3.21>
Chunk referenced in 3.9
<set path for cerg 3.12> =
<set common path for Linux systems 3.22>
<set path for dimboola 3.13> =
<set common path for MacOSX systems 3.21>
<set path for burnley 3.14> =
<set common path for Linux systems 3.22>
Chunk referenced in 3.9
<set path for everton 3.15> =
<set common path for Linux systems 3.22>
Chunk referenced in 3.9
<set path for gwuc 3.16> =
if [ $user = johnhurst ] ; then PATH="/sbin:$PATH" # system binaries PATH="/usr/sbin:/usr/bin:$PATH" # user binaries PATH="/usr/local/bin:$PATH" # local binaries PATH="/usr/X11R6/bin:$PATH" # X11 binaries PATH="$HOME/bin:$PATH" # personal binaries PATH="$HOME/bin/macosx:$PATH" # personal system binaries PATH=".:$PATH" # cwd binaries else echo "I don't know user $user" exit 1 fi
<set path for newport 3.17> =
<set common path for Linux systems 3.22> PATH="$HOME/Applications:$PATH"
Chunk referenced in 3.9
<set path for reuilly 3.18> =
<set common path for Linux systems 3.22>
<set path for spencer 3.19> =
<set common path for Linux systems 3.22>
Chunk referenced in 3.9
<set path for gwuc-wiki 3.20> =
<set common path for Linux systems 3.22>
Chunk referenced in 3.9
<set common path for MacOSX systems 3.21> =
if [ $user = ajh ] ; then PATH="/sbin:$PATH" # system binaries PATH="/usr/sbin:/usr/bin:$PATH" # user binaries PATH="$HOME/bin:$PATH" # personal binaries PATH="$HOME/binln:$PATH" # personal binary links PATH="$HOME/bin/macosx:$PATH" # personal system binaries PATH=".:$PATH" # cwd binaries elif [ $user = root ] ;then PATH="/sbin:$PATH" # system binaries PATH="/usr/sbin:/usr/bin:$PATH" # user system and binaries else echo "Unknown user $user" exit 1 fi
Chunk referenced in 3.9 3.11 3.13 3.23
<set common path for Linux systems 3.22> =
if [ $user = ajh ] ; then PATH="/usr/sbin:/sbin" # system binaries PATH="/usr/bin:/bin:$PATH" # user binaries PATH="/usr/X11R6/bin:$PATH" # X11 binaries PATH="/usr/local/bin:$PATH" # local binaries PATH="$HOME/.local/bin:$PATH" # pip binaries PATH="$HOME/binln:$PATH" # local binaries PATH="$HOME/bin:$PATH" # local binaries PATH="$HOME/bin/i386:$PATH" # personal system binaries PATH=".:$PATH" # cwd binaries elif [ $user = root ] ;then PATH="/sbin:$PATH" # system binaries PATH="/usr/sbin:/usr/bin:$PATH" # user system and binaries PATH="/usr/local/bin:$PATH" # local binaries PATH="/usr/local/sbin:$PATH" # local system binaries else echo "Unknown user $user" exit 1 fi
Chunk referenced in 3.9 3.10 3.12 3.14 3.15 3.17 3.18 3.19 3.20

Note that there are two personal bin directories for Linux systems:

  1. $HOME/binln, which contains links specific to each architecture and machine for standard binaries, such as Python, which vary from machine to machine. For this reason, entries in this directory are excluded from backup and synchronization operations.
  2. $HOME/bin, which contains non-architecture specific scripts, such as shell scripts and other high level programs. This directory is included in synchronization and backup operations.

<set path for defaults 3.23> =
<set common path for MacOSX systems 3.21>
Chunk referenced in 3.9

The defaults settings assume that we are on a laptop (bittern, but either no hostname, or foreign hostname), so that we go for the standard Mac OS X settings.

<set paths on all machines 3.24> =
Chunk referenced in 3.8
Chunk defined in 3.9,3.24

Now empty, but kept for future use.

<do root related login things here 3.25> =
echo "Welcome to $HOST!" touch $HOME/.online
Chunk referenced in 3.8
<do non-root related login things here 3.26> =
: # do nothing at this stage
Chunk referenced in 3.8

Set the environment variable RSYNC_RSH, which defines the shell transport for rsync as the secure shell ssh.

<set sundry environment variables 3.27> =
export ASSOCDB=/home/ajh/Computers/assoc/files export RSYNC_RSH="ssh -2 " <set LD LIBRARY PATH environment variable 3.30> <set MANPATH environment variable 3.31> <set XMLLIB environment variable 3.32> # standard cases, os specific #echo "HOST=$HOST" case $HOST in albens* | albury* | burnley* | everton* | gwuc-wiki* | jeparit* | kerang* | newport* | reuilly* | spencer* | terang* ) <set env vars for standard linux 3.28> ;; bittern* | wodonga* ) <set env vars for standard MacOSX 3.29> ;; *) echo "$0: Using Linux defaults to set environment variables for $HOST" <set env vars for standard linux 3.28> ;; esac # special cases case $HOST in dimboola* ) export EMACSHEIGHT=110 export EMACSWIDTH=80 ;; # fall through otherwise esac
Chunk referenced in 3.8
<set env vars for standard linux 3.28> =
PYTHONPATH=/home/ajh/Computers/python PYTHONPATH=.:/home/ajh/lib/python:$PYTHONPATH export PYTHONPATH export SOLAREDGE_API_KEY=GE7TUP2M3AD7KVNTEBZBCR4WZV19SB78 export SOLAREDGE_SITEID=2981952
Chunk referenced in 3.27
<set env vars for standard MacOSX 3.29> =
PYTHONPATH=/usr/local/lib/python PYTHONPATH=/home/ajh/Computers/python:$PYTHONPATH PYTHONPATH=/Users/ajh/lib/python:$PYTHONPATH export PYTHONPATH
Chunk referenced in 3.27
<set LD LIBRARY PATH environment variable 3.30> =
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/sgml/xml4c2_3_1/lib
Chunk referenced in 3.27
<set MANPATH environment variable 3.31> =
export MANPATH="/usr/share/man:/usr/X11R6/man"
Chunk referenced in 3.27
<set XMLLIB environment variable 3.32> =
export XMLLIB=".:/home/ajh/lib/xml:/home/ajh/web/trains" export XML_CATALOG_FILES="/home/ajh/etc/xml/catalog"
Chunk referenced in 3.27

3.4 Set the PYTHONPATH

The python systems have different paths for different systems. Set them up here.

<set python path for MacOSX 3.33> =
PYTHONPATH=/usr/local/lib/python PYTHONPATH=/home/ajh/Computers/python:$PYTHONPATH PYTHONPATH=/Users/ajh/lib/python:$PYTHONPATH export PYTHONPATH
<set python path for gwuc-wiki 3.34> =
PYTHONPATH=/usr/local/lib/python2.6 PYTHONPATH=/home/ajh/Computers/python:$PYTHONPATH PYTHONPATH=/home/ajh/lib/python:$PYTHONPATH export PYTHONPATH

3.5 Set Background Colour

".set_colours.sh" 3.35 =
#DO NOT EDIT this file! see $HOME/Computers/Sources/Setup/setup.xlp instead #echo "start .set_colours.sh" if [ "X$HOST"="X" ] ; then if [ -x /bin/hostname ] ; then HOSTNAME=`/bin/hostname` else echo "$0: Unable to determine machine name, no /bin/hostname" fi export HOSTNAME HOST=`$EXPR $HOSTNAME : '\([^.]*\)'` export HOST fi case $HOST in albens* ) export BGCOLOUR=<bg-colour-albens 1.21> ;; albury* ) export BGCOLOUR=<bg-colour-albury 1.7> ;; bittern* ) export BGCOLOUR=<bg-colour-bittern 1.9> ;; burnley*) export BGCOLOUR=<bg-colour-burnley 1.10> ;; everton*) export BGCOLOUR=<bg-colour-everton 1.5> ;; gwuc-wiki* ) export BGCOLOUR=<bg-colour-gwuc-wiki 1.17> ;; jeparit*) export BGCOLOUR=<bg-colour-jeparit 1.4> ;; kerang*) export BGCOLOUR=<bg-colour-kerang 1.11> ;; newport*) export BGCOLOUR=<bg-colour-newport 1.16> ;; reuilly*) export BGCOLOUR=<bg-colour-reuilly 1.22> ;; spencer* ) export BGCOLOUR=<bg-colour-spencer 1.2> ;; terang*) export BGCOLOUR=<bg-colour-terang 1.13> ;; *) echo "$0: No case branch to set BGCOLOUR for $HOST" esac #echo "end .set_colours.sh"

4. The Set Machine file

"setmachine" 4.1 =
#!/bin/bash machine=$1 mv $HOME/.xinitrc $HOME/.xinitrc.sav mv $HOME/.xdefaults $HOME/.xdefaults.sav

This script is intended to provide parameterizarion of all X Windows settings in one consistent place. Currently (20180115:130245) under development. The individual machine files follow.

"Xinitrc.newport" 4.2 =
# dummy file
"Xdefaults.newport" 4.3 =
! Parts (C) 1996 By Greg J. Badros <gjb@cs.duke.edu> ! You may use this file as specified under the GNU General Public License *font: 6x10 !*font: 6x10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! emacs emacs*background: #ccffcc emacs*foreground: black emacs*pointerColor: orchid emacs*cursorColor: orchid emacs*bitmapIcon: on emacs*font: 6x10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! xterm (and friends) xterm*geometry: 82x24+0-1400 xterm*background: #ccffcc XTerm*highlightSelection: true ! Uncomment this to use color for the bold attribute XTerm*VT100*colorBDMode: on XTerm*VT100*colorBD: blue ! Uncomment this to use color for underline attribute XTerm.VT100*colorULMode: on XTerm.VT100*underLine: off XTerm*VT100*colorUL: magenta ! Uncomment this to display the scrollbar XTerm*scrollBar: true ! This resource specifies whether or not to ignore the 'alternate screen' ! of applications such as vi. When it is on, these applications will restore ! the contents of the screen when they are exited to what they were before ! they were started. When it is off, the contents of vi will remain on the ! screen after the program is quit. XTerm.VT100.titeInhibit: true ! Uncomment this to turn off color mode in your xterms !XTerm.VT100*colorMode: off XTerm.VT100*dynamicColors: on ! Number of lines of scrollback to save XTerm*saveLines: 1500 xterm*reverseWrap: true xterm*visualBell: true xterm*scrollTtyOutput: False xterm*scrollKey: True xterm*Scrollbar.JumpCursor: True
"Xinitrc.burnley" 4.4 =
# dummy file
"Xdefaults.burnley" 4.5 =
! Parts (C) 1996 By Greg J. Badros <gjb@cs.duke.edu> ! You may use this file as specified under the GNU General Public License *font: 6x10 !*font: 6x10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! emacs emacs*background: #ccffcc emacs*foreground: black emacs*pointerColor: orchid emacs*cursorColor: orchid emacs*bitmapIcon: on emacs*font: 6x10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! xterm (and friends) xterm*geometry: 82x24+0-0 xterm*background: #ccffcc XTerm*highlightSelection: true ! Uncomment this to use color for the bold attribute XTerm*VT100*colorBDMode: on XTerm*VT100*colorBD: blue ! Uncomment this to use color for underline attribute XTerm.VT100*colorULMode: on XTerm.VT100*underLine: off XTerm*VT100*colorUL: magenta ! Uncomment this to display the scrollbar XTerm*scrollBar: true ! This resource specifies whether or not to ignore the 'alternate screen' ! of applications such as vi. When it is on, these applications will restore ! the contents of the screen when they are exited to what they were before ! they were started. When it is off, the contents of vi will remain on the ! screen after the program is quit. XTerm.VT100.titeInhibit: true ! Uncomment this to turn off color mode in your xterms !XTerm.VT100*colorMode: off XTerm.VT100*dynamicColors: on ! Number of lines of scrollback to save XTerm*saveLines: 1500 xterm*reverseWrap: true xterm*visualBell: true xterm*scrollTtyOutput: False xterm*scrollKey: True xterm*Scrollbar.JumpCursor: True

5. The Bash Resource Control file .bashrc

The .bashrc file is read every time a bash shell is started. For interactive shells, we need to set the aliases and the prompt.

".bashrc" 5.1 =
#<edit warning 2.1> # version=<current version 12.1>, <current date 12.2> #echo "start .bashrc" <determine time zone 3.2> <determine where we are 3.4,3.5,3.6> # append to the history file, don't overwrite it shopt -s histappend <bashrc: setup aliases 5.2,5.3> <bashrc: set the prompt 5.8> <determine if primary login 5.9> #cd $HOME #echo "end .bashrc"

5.1 Define aliases

<bashrc: setup aliases 5.2> =
alias a='alias' alias d='dirs' alias fbak="find . \( -name '*~*' -o -name '*.bak' \) -print" alias frmbak="find . \( -name '*~*' -o -name '*.bak' \) -print -exec rm {} \;" alias h='history' alias hangups='fgrep "Modem hangup" /var/log/messages' alias l='ls -F' alias ll='ls -Fltr' alias LL='ls -Fl' alias m='more' alias rmbak='rm .*~* *~* *-lw* *% .*% *# ,* *.bak .*.bak 2>/dev/null' # this alias cribbed from the standard .bashrc file # use for long-running commands. Example: sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # hard work follows to make '+' work as pushd, '-' work as popd function up () { cd ..; } #function + () { # Doesn't work! function mypushd () { if [ "X$1" = "X" ] ; then pushd else pushd "$1" fi;}{Note 5.2.1} eval alias '+'=mypushd function mypopd () { popd; } eval 'function - () { popd; }' #source /home/ajh/bin/makeminusalias.sh #eval alias '\-'=mypopd
Chunk referenced in 5.1
Chunk defined in 5.2,5.3
{Note 5.2.1}
Note that the argument to pushd in the definition of + must be quoted, to avoid problems with directories names containing embedded spaces. But we also have to be careful with empty parameters!

Note the bizarre behaviour here. I cannot define a function '+', since '+' is not a valid identifier. But '-' is. On the other hand, I cannot make an alias for '-', but I can for '+'. Work that one out.

At least, all's well that ends well.

20091020:094011 No, not really. While the script works as such, the Makefile barfs when it tries to execute (source?) the offending eval function line. Got no further clues at this stage.

<bashrc: setup aliases 5.3> =
function tsize () { stty -a |sed -n '/rows.*columns/ s/.*\(rows[^;][^;]*;[^;][^;]*\);.*/\1/p'; } function killer () { kill -KILL $(ps xc | grep -wi "$*" | awk '{print $1}'); } function set-title() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} } case $HOST in gwuc-wiki* ) <specific aliases for gwuc-wiki 5.5> ;; nexus* ) <specific aliases for nexus > ;; wodonga* ) <specific aliases for wodonga 5.7> ;; albens* | albury* | burnley* | everton* | newport* | reuilly* | spencer* ) <specific aliases for ubuntu/debian 5.6> ;; *) ;; esac
Chunk referenced in 5.1
Chunk defined in 5.2,5.3
<specific aliases for albens 5.4> =
# none as yet
<specific aliases for gwuc-wiki 5.5> =
alias tlwww='tail -f /var/log/apache2/error.log' alias tlxml='tail -f /home/ajh/local/$HOST/xmlerror.log'
Chunk referenced in 5.3
<specific aliases for ubuntu/debian 5.6> =
alias open=gnome-open alias ls >/dev/null 2>&1 if [ $? -eq 0 ] ; then unalias ls # to cancel Ubuntu defaults fi
Chunk referenced in 5.3
<specific aliases for wodonga 5.7> =
alias tlwww='tail -f /var/log/httpd/error_log' alias tlxml='tail -f /home/ajh/local/$HOST/xmlerror.log' function set-title() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$*\a\]" PS1=${ORIG}${TITLE} }
Chunk referenced in 5.3

5.2 Define the shell prompt

I like the prompt to show what directory I'm in, as well as the usual login and machine names. Throw in the history number for good measure. But don't set the prompt command if we are in the primary login shell, since it fouls up the window title and/or prompt.

<bashrc: set the prompt 5.8> =
PS1='\n$USER@$HOST $PWD \! $ ' if [ ${SHLVL} -ne 0 ] ; then PROMPT_COMMAND='$HOME/bin/bash-prompt' fi
Chunk referenced in 5.1

This shell script is because bash does not have the equivalent of cwdcmd that tcsh has. So we set up the PROMPT_COMMAND variable to execute this script, which looks at the current heading, the current directory, and sees whether an explicit repainting of the window title bar is necessary.

5.3 Determine if Primary Login

This code used to be called from .bash_profile, but key environment variables were not set at this stage. Hence it is now invoked in .bashrc.

<determine if primary login 5.9> =
if [ X$TERM = X -o X$TERM = Xlinux ] ; then export LOGINLVL=0 else export LOGINLVL=1 fi
Chunk referenced in 5.1

We need to know if we are in the primary login shell. This may be different for various machines, since some may be xdm driven, while others just give a tty login. The outcome of this code is to set the variable LOGINLVL to 0 if we are at the primary login level, 1 otherwise.

5.4 The bash-prompt file

The bash-prompt file does cool things like set the window title to the path name of the current directory. It is programmed as a separate executable file, due to bash's idiosyncracies (it can be done as an alias in cshrc).

"bash-p" 5.10 =
#!/bin/bash # # <edit warning 2.1> # curhead=$PWD if [ -f ${HEADING:-"..."} ] ; then head=`/bin/cat $HEADING` fi if [ "X$curhead" != "X$head" ] ; then if [ X$TERM = Xxterm ] ; then PWDB=`/usr/bin/basename $PWD` if [ X$USER != Xajh ] ; then TITLE="${USER}@${HOST}:${PWD}" ICON="${USER}@${HOST}:${PWD}" else TITLE="*${PWDB}*${HOST}:${PWD}" ICON="*${PWDB}*${HOST}:${PWD}" fi echo -n "<set heading 5.11>" fi head=$curhead if [ -f ${HEADING:-"..."} ] ; then echo $head >$HEADING fi fi

The following wonderful piece of code is the magic to set the X windows title bar to the host name and directory, in the format HOST:directory for the full window, and HOST:basename for the iconified form.

However, since we cannot enter the character sequence directly, the code must be translated subsequently to include the escape characters. This is done in the Makefile, by translating the temporary file bash-p to bash-prompt.

<set heading 5.11> = {esc}]2;${TITLE}{bel}{esc}]1;${ICON}{bel}
Chunk referenced in 5.10

6. .texrc The TeX Resource Control file

This file is responsible for setting environment variables to enable {\TeX} to run. I've made it a separate file, so that it can be sourced from other places as necessary to use {\TeX}.

".texrc" 6.1 =
#<edit warning 2.1> case $HOST in bittern* | \ dyn* | roaming-* | its--roaming* | dhcp7-218* | bsit-roaming* ) \ <texrc for MacOSX 6.2>;;{Note 6.1.1} albens* | albury* | burnley* | everton* | kerang* | newport* | reuilly* | spencer* ) \ <texrc for ubuntu 6.3>;; gwuc-wiki* )<texrc for non-tex machines 6.4>;; cerg* | vm-cerg* )<texrc for non-tex machines 6.4>;; *) echo "No case branch for .texrc for $HOSTNAME" ;; esac
{Note 6.1.1}
note: NO LEADING SPACES!
<texrc for MacOSX 6.2> =
TEXINPUTS=".:\ $HOME/Computers/tex/inputs:\ $HOME/Computers/tex/tex-in-practice:\ $HOME/lib/texmf/tex:\ $HOME/lib/texmf/tex/plain:\ $HOME/lib/texmf/tex/latex:\ $HOME/lib/texmf/tex/latex/beamer/base:\ /usr/local/share/texmf:\ /sw/share/texmf:" export TEXINPUTS TEXFORMATS="/sw/var/lib/texmf/web2c:" export TEXFORMATS
Chunk referenced in 6.1

20050725:160750 Removed the TEXFORMATS path to my local formats directory. This is now handled in the ~/lib/texmf directory.

<texrc for ubuntu 6.3> =
TEXINPUTS=".:\ /usr/share/texmf-tetex/tex/generic/babel:\ /usr/share/texmf-tetex/tex/latex/amsfonts:\ /usr/share/texmf-tetex/tex/latex/base:\ /usr/share/texmf-tetex/tex/latex/graphics:\ /usr/share/texmf-tetex/tex/latex/hyperref:\ /usr/share/texmf-tetex/tex/latex/misc:\ /usr/share/texmf-tetex/tex/latex/tools:\ $HOME/Computers/tex/tex-in-practice:\ $HOME/Computers/tex/inputs:\ $HOME/lib/texmf/tex:\ $HOME/lib/texmf/tex/plain:\ $HOME/lib/texmf/tex/latex:" export TEXINPUTS TEXFORMATS="$HOME/tex/formats:/usr/share/texmf/web2c:" export TEXFORMATS
Chunk referenced in 6.1
<texrc for non-tex machines 6.4> =
Chunk referenced in 6.1

Empty, because we don't use TeX on these machines

7. .sgmlrc The SGML Resource Control file

This file is responsible for setting environment variables to enable SGML and related programs to run. I've made it a separate file, so that it can be sourced from other places as necessary to use SGML.

".sgmlrc" 7.1 =

8. Logging out: The bash logout file

".bash_logout" 8.1 =
if [ ${HEADING:-0} != 0 ] ; then rm $HEADING fi if [ $LOGINLVL -eq 0 ] ; then rm $HOME/etc/heading* rm $HOME/.online fi

Remove the window heading file for this process, and clean up all the window heading and counting files if we are at the bash shell level.

Kill any rootimage (background image) process.

Colour Allocation

ajh

Version 1.9.2

20200426:214029

9. Window Colours

This section is defined here not so much because it is used by this suite, as because it seems the best place to define what are system wide resources, used in a range of applications. Cut and paste the following definitions as required.

<colours 1.1> =
<bg-colour-albens 1.21> <bg-colour-albury 1.7> <bg-colour-bittern 1.9> <bg-colour-bulletin 1.8> <bg-colour-burnley 1.10> <bg-colour-everton 1.5> <bg-colour-everton-root 1.25> <bg-colour-fat-controller 1.12> <bg-colour-geelong 1.3> <bg-colour-gwuc 1.14> <bg-colour-gwuc-wiki 1.17> <bg-colour-jeparit 1.4> <bg-colour-kerang 1.11> <bg-colour-newport 1.16> <bg-colour-newport-root 1.20> <bg-colour-pandorea 1.6> <bg-colour-reuilly 1.22> <bg-colour-reuilly-root 1.15> <bg-colour-spencer 1.2> <bg-colour-spencer-root 1.26> <bg-colour-terang 1.13> <bg-colour-terang-root 1.23> <bg-colour-wodonga 1.19> <bg-colour-wodonga-root 1.18>
Chunk defined in 1.1,1.62
R=FF
B=FF B=CC B=99 B=66 B=33 B=00
G=FF ffffff ffffcc <bg-colour-spencer 1.2> = rgb:ff/ff/99
Chunk referenced in 3.35 1.1
ffff66 <bg-colour-geelong 1.3> = rgb:ff/ff/33
Chunk referenced in 1.1
ffff00
G=CC ffccff <bg-colour-jeparit 1.4> = rgb:ff/cc/cc
Chunk referenced in 3.35 1.1
ffcc99 <bg-colour-everton 1.5> = rgb:ff/cc/66
Chunk referenced in 3.35 1.1
ffcc33 ffcc00
G=99 <bg-colour-pandorea 1.6> = rgb:ff/99/ff
Chunk referenced in 1.1
ff99cc <bg-colour-albury 1.7> = rgb:ff/99/99
Chunk referenced in 3.35 1.1
ff9966 ff9933 ff9900
G=66 ff66ff ff66cc ff6699 <bg-colour-bulletin 1.8> = rgb:ff/66/66
Chunk referenced in 1.1
ff6633 ff6600
G=33 ff33ff ff33cc ff3399 ff3366 ff3333 ff3300
G=00 ff00ff ff00cc ff0099 ff0066 ff0033 ff0000
R=CC
B=FF B=CC B=99 B=66 B=33 B=00
G=FF <bg-colour-bittern 1.9> = rgb:cc/ff/ff
Chunk referenced in 3.35 1.1
ccffcc <bg-colour-burnley 1.10> = rgb:cc/ff/99
Chunk referenced in 3.35 1.1
ccff66 <bg-colour-kerang 1.11> = rgb:cc/ff/33
Chunk referenced in 3.35 1.1
ccff00
G=CC ccccff cccccc cccc99 <bg-colour-fat-controller 1.12> = rgb:cc/cc/66
Chunk referenced in 1.1
cccc33 cccc00
G=99 cc99ff cc99cc <bg-colour-terang 1.13> = rgb:cc/99/99
Chunk referenced in 3.35 1.1
cc9966 <bg-colour-gwuc 1.14> = rgb:cc/99/33
Chunk referenced in 1.1
cc9900
G=66 cc66ff cc66cc cc6699 cc6666 cc6633 cc6600
G=33 cc33ff cc33cc cc3399 cc3366 cc3333 <bg-colour-reuilly-root 1.15> = rgb:cc/33/00
Chunk referenced in 1.1
G=00 cc00ff cc00cc cc0099 cc0066 cc0033 cc0000
R=99
B=FF B=CC B=99 B=66 B=33 B=00
G=FF 99ffff 99ffcc <bg-colour-newport 1.16> = rgb:99/ff/99
Chunk referenced in 3.35 1.1
<bg-colour-gwuc-wiki 1.17> = rgb:99/ff/66
Chunk referenced in 3.35 1.1
99ff33 99ff00
G=CC 99ccff 99cccc 99cc99 99cc66 99cc33 99cc00
G=99 9999ff 9999cc 999999 999966 999933 999900
G=66 9966ff 9966cc 996699 996666 996633 996600
G=33 9933ff 9933cc 993399 993366 993333 993300
G=00 9900ff 9900cc <bg-colour-wodonga-root 1.18> = rgb:99/00/99
Chunk referenced in 1.1
990066 990033 990000
R=66
B=FF B=CC B=99 B=66 B=33 B=00
G=FF 66ffff 66ffcc 66ff99 <bg-colour-wodonga 1.19> = rgb:66/ff/66
Chunk referenced in 1.1
66ff33 66ff00
G=CC 66ccff 66cccc 66cc99 66cc66 66cc33 66cc00
G=99 6699ff 6699cc 669999 669966 669933 669900
G=66 6666ff 6666cc 666699 666666 666633 666600
G=33 6633ff 6633cc 663399 663366 663333 663300
G=00 6600ff 6600cc 660099 <bg-colour-newport-root 1.20> = rgb:66/00/66
Chunk referenced in 1.1
660033 660000
R=33
B=FF B=CC B=99 B=66 B=33 B=00
G=FF 33ffff <bg-colour-albens 1.21> = rgb:33/ff/cc
Chunk referenced in 3.35 1.1
33ff99 33ff66 33ff33 33ff00
<bg-colour-reuilly 1.22> = rgb:33/cc/ff
Chunk referenced in 3.35 1.1
33cccc 33cc99 33cc66 33cc33 33cc00
3399ff
3366ff 3366cc 336699 <bg-colour-terang-root 1.23> = rgb:33/66/66
Chunk referenced in 1.1
336633 336600
3333ff <bg-colour-ouyen-root 1.24> = rgb:33/33/cc
333399 333366 333333 333300
3300ff 3300cc 330099 330066 330033 330000
R=00
B=FF B=CC B=99 B=66 B=33 B=00
G=FF 00ffff 00ff99 00ff66 00ff33 00ff00
00ccff
0099ff
0066ff 0066cc 006699 006666 006633 006600
0033ff <bg-colour-everton-root 1.25> = rgb:00/33/99
Chunk referenced in 1.1
0000ff 0000cc 000099 <bg-colour-spencer-root 1.26> = rgb:00/00/66
Chunk referenced in 1.1
000033 000000

For reference:

Hex Decimal
ff 255
cc 204
99 153
66 102
33 51
0 0

9.1 Obsolete Machines

These machines have been decomissioned, but their colours are recorded for posterity.

<bg-colour-heywood-root 1.27> = rgb:00/66/66
Chunk referenced in 1.62
<bg-colour-richmond-root 1.28> = rgb:33/00/99
Chunk referenced in 1.62
<bg-colour-bastille 1.29> = rgb:33/ff/cc
Chunk referenced in 1.62
<bg-colour-echuca-root 1.30> = rgb:66/00/00
Chunk referenced in 1.62
<bg-colour-auteuil 1.31> = rgb:66/cc/cc
Chunk referenced in 1.62
<bg-colour-redfern 1.32> = rgb:66/ff/99
Chunk referenced in 1.62
<bg-colour-orsay 1.33> = rgb:66/ff/cc
Chunk referenced in 1.62
<bg-colour-montparnasse 1.34> = rgb:99/cc/99
Chunk referenced in 1.62
<bg-colour-meconopsis 1.35> = rgb:99/ff/66
Chunk referenced in 1.62
<bg-colour-central 1.36> = rgb:99/ff/99
Chunk referenced in 1.62
<bg-colour-echuca 1.37> = rgb:99/ff/ff
Chunk referenced in 1.62
<bg-colour-clematis 1.38> = rgb:99/ff/ff
Chunk referenced in 1.62
<bg-colour-bruce 1.39> = rgb:cc/99/99
Chunk referenced in 1.62
<bg-colour-nexus 1.40> = rgb:cc/99/cc
Chunk referenced in 1.62
<bg-colour-hawthorn 1.41> = rgb:cc/99/ff
Chunk referenced in 1.62
(Note: cerg and hawthorn colours swapped 20090303:104915)
<bg-colour-ouyen 1.42> = rgb:cc/cc/33
Chunk referenced in 1.62
<bg-colour-garedelyon 1.43> = rgb:cc/cc/99
Chunk referenced in 1.62
<bg-colour-sng 1.44> = rgb:cc/cc/ff
Chunk referenced in 1.62
<bg-colour-rainbow 1.45> = rgb:cc/ff/00
Chunk referenced in 1.62
<bg-colour-richmond 1.46> = rgb:cc/ff/66
Chunk referenced in 1.62
(Note: was ballarat, then dimboola (20091130), then richmond)
<bg-colour-ballarat 1.47> = rgb:cc/ff/66
Chunk referenced in 1.62
<bg-colour-ringwood 1.48> = rgb:cc/ff/99
Chunk referenced in 1.62
<bg-colour-dimboola 1.49> = rgb:cc/ff/cc
Chunk referenced in 1.62
<bg-colour-cerg 1.50> = rgb:cc/ff/ff
Chunk referenced in 1.62
<bg-colour-heywood 1.51> = rgb:ff/99/cc
Chunk referenced in 1.62
(Note: reallocated to albury 20240227:184813)
<bg-colour-bendigo 1.52> = rgb:ff/99/cc
Chunk referenced in 1.62
(Note: moved from ffcccc 20121119:174143)
<bg-colour-eregnans 1.53> = rgb:ff/cc/66
Chunk referenced in 1.62
<bg-colour-sequoia 1.54> = rgb:ff/cc/99
Chunk referenced in 1.62
<bg-colour-hamilton 1.55> = rgb:ff/cc/99
Chunk referenced in 1.62
<bg-colour-wolseley 1.56> = rgb:ff/cc/cc
Chunk referenced in 1.62
<bg-colour-lilydale 1.57> = rgb:ff/cc/ff
Chunk referenced in 1.62
<bg-colour-flinders 1.58> = rgb:ff/ff/00
Chunk referenced in 1.62
<bg-colour-quorn 1.59> = rgb:ff/ff/66
Chunk referenced in 1.62
(Note: murtoa, ararat and quorn swapped 20090305:104557)
<bg-colour-ararat 1.60> = rgb:ff/ff/99
Chunk referenced in 1.62
(Note: murtoa, ararat and quorn swapped 20090305:104557)
<bg-colour-murtoa 1.61> = rgb:ff/ff/cc
Chunk referenced in 1.62
<colours 1.62> =
<bg-colour-ararat 1.60> <bg-colour-auteuil 1.31> <bg-colour-ballarat 1.47> <bg-colour-bastille 1.29> <bg-colour-bendigo 1.52> <bg-colour-bruce 1.39> <bg-colour-central 1.36> <bg-colour-cerg 1.50> <bg-colour-clematis 1.38> <bg-colour-dimboola 1.49> <bg-colour-echuca 1.37> <bg-colour-echuca-root 1.30> <bg-colour-eregnans 1.53> <bg-colour-flinders 1.58> <bg-colour-garedelyon 1.43> <bg-colour-hamilton 1.55> <bg-colour-hawthorn 1.41> <bg-colour-heywood 1.51> <bg-colour-heywood-root 1.27> <bg-colour-junee > <bg-colour-lilydale 1.57> <bg-colour-meconopsis 1.35> <bg-colour-montparnasse 1.34> <bg-colour-murtoa 1.61> <bg-colour-nexus 1.40> <bg-colour-orsay 1.33> <bg-colour-ouyen 1.42> <bg-colour-quorn 1.59> <bg-colour-rainbow 1.45> <bg-colour-redfern 1.32> <bg-colour-richmond 1.46> <bg-colour-richmond-root 1.28> <bg-colour-ringwood 1.48> <bg-colour-sequoia 1.54> <bg-colour-sng 1.44> <bg-colour-wolseley 1.56>
Chunk defined in 1.1,1.62

bastille was moved to 33ffcc to clarify distinction with dimboola

10. The Makefile

The Makefile handles the nitty-gritty of copying files to the right places, and setting permissions, etc.

Note the nifty use of an XLP literate program macro to handle the intricacies of installing files on different machines. The THISHOST variable is set to the non-qualified name of the machine, and used to check if we are copied to the local or a remote machine. Different copy operations are required in each case.

<install on machine X 9.1> =
install-machine: install $(INSTALLFILES) @if [ "machine" = "$(THISHOST)" ] ; then \ cp $(INSTALLHOME) ${HOME}/ ;\ cp $(INSTALLBIN) ${HOME}/bin/ ;\ echo "copied install files to localhost" ;\ else \ rsync -aquv $(INSTALLHOME) machine: ;\ rsync -aquv $(INSTALLBIN) machine:bin/ ;\ echo "copied install files to machine" ;\ ssh machine echo 'machine' >.machine ;\ fi
Chunk referenced in 9.2
"Makefile" 9.2 =
default=setup flags=-2 bash THISHOST=`$(HOME)/bin/shorthost` WEBPAGE=/home/ajh/public_html/research/literate #FILES=.bash_profile .bashrc .bash_logout XSLLIB=/home/ajh/lib/xsl XSLFILES=$(XSLLIB)/lit2html.xsl $(XSLLIB)/tables2html.xsl INSTALLHOME=.bash_profile .texrc .bash_logout .bashrc .set_colours.sh INSTALLBIN=setmachine bash-prompt INSTALLFILES=$(INSTALLHOME) $(INSTALLBIN) include $(HOME)/etc/MakeXLP html: setup.html setup.tangle setup.xml: setup.xlp colours.xlp xsltproc --xinclude -o setup.xml $(XSLLIB)/litprog.xsl setup.xlp touch setup.tangle setup.html: setup.xml $(XSLFILES) xsltproc --xinclude $(XSLLIB)/lit2html.xsl setup.xml >setup.html <install parms X >(machine='albens') <install on machine X 9.1>(machine='albens') <install parms X >(machine='albury') <install on machine X 9.1>(machine='albury') <install parms X >(machine='burnley') <install on machine X 9.1>(machine='burnley') <install parms X >(machine='everton') <install on machine X 9.1>(machine='everton') <install parms X >(machine='jeparit') <install on machine X 9.1>(machine='jeparit') <install parms X >(machine='kerang') <install on machine X 9.1>(machine='kerang') <install parms X >(machine='newport') <install on machine X 9.1>(machine='newport') <install parms X >(machine='reuilly') <install on machine X 9.1>(machine='reuilly') <install parms X >(machine='spencer') <install on machine X 9.1>(machine='spencer') <install parms X >(machine='terang') <install on machine X 9.1>(machine='terang') <install parms X >(machine='gwuc-wiki') <install on machine X 9.1>(machine='gwuc-wiki') <install parms X >(machine='wodonga') <install on machine X 9.1>(machine='wodonga') install: $(INSTALLFILES) synch: /home/ajh/bin/synch -tfr ${default}.w web: $(WEBPAGE)/setup.html $(WEBPAGE)/setup.html: setup.html cp -p setup.html $(WEBPAGE)/setup.html bash-prompt: setup.tangle @/home/ajh/bin/trans-esc-bel bash-p bash-prompt rm bash-p ${HOME}/%: % @if [ -f $@ ] ; then \ diff -q $@ $< >/dev/null ;\ if [ $$? -eq 1 ] ; then \ echo cp $< $@ ;\ cp $< $@ ;\ fi ;\ else \ echo cp $< $@ ;\ cp $< $@ ;\ fi ${HOME}/bin/%: % @if [ -f $@ ] ; then \ diff -q $@ $< >/dev/null ;\ if [ $$? -eq 1 ] ; then \ echo chmod 755 $< ; cp $< $@ ;\ chmod 755 $< ;\ cp $< $@ ;\ fi ;\ else \ echo chmod 755 $< ; cp $< $@ ;\ chmod 755 $< ;\ cp $< $@ ;\ fi all: install setup.dvi Makefile: setup.tangle

I had to kludge the bash-prompt construction. Since it relies upon two control characters that foul up this literate program, they are represented by the strings {esc} and {bel} respectively in the bash-prompt template file, bash-p (See <set heading 5.11>). A sed script in the Makefile trans-esc-bel then does the magic of converting these to the real thing. The definitions of the shell variables e and b allow us to manipulate the otherwise unrepresentable control characters. Each of these is formed by translating a dummy character into the control character.

This was the entry in the Makefile, but it doesn't appear to work.

20091020:093027 The list of files to install has been re-ordered, so that .bashrc appears last. It is the one causing the error, but it still seems to install correctly. By making it last, all the other (non-error making) ones get installed first.

	e=`echo e | tr e '\033'` \
	b=`echo b | tr b '\007'` \
	sed -e "s/{esc}/$$e/g" -e "s/{bel}/$$b/g" bash-p >bash-prompt
  

11. Default .bashrc

This code is the code supplied as default to .bashrc. It is included here for archival reasons, and to pick any bones that may be present.

<default.bashrc 10.1> =
# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it # added to .bashrc, ajh 20240111:130953 shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # If set, the pattern "**" used in a pathname expansion context will # match all files and zero or more directories and subdirectories. #shopt -s globstar # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color|*-256color) color_prompt=yes;; esac # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 # (ISO/IEC-6429). (Lack of such support is extremely rare, and such # a case would tend to support setf rather than setaf.) color_prompt=yes else color_prompt= fi fi if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt # If this is an xterm set the title to user@host:dir case "$TERM" in xterm*|rxvt*) PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" ;; *) ;; esac # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # colored GCC warnings and errors #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # some more ls aliases alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi

12. Indices

12.1 Files

File Name Defined in
.bash_logout 8.1
.bash_profile 3.1
.bashrc 5.1
.set_colours.sh 3.35
.sgmlrc 7.1
.texrc 6.1
Makefile 9.2
Xdefaults.burnley 4.5
Xdefaults.newport 4.3
Xinitrc.burnley 4.4
Xinitrc.newport 4.2
bash-p 5.10
setmachine 4.1

12.2 Chunks

Chunk Name Defined in Used in
bash: set variables 3.8 3.1
bashrc: set the prompt 5.8 5.1
bashrc: setup aliases 5.2, 5.3 5.1
bg-colour-albens 1.21 3.35, 1.1
bg-colour-albury 1.7 3.35, 1.1
bg-colour-ararat 1.60 1.62
bg-colour-auteuil 1.31 1.62
bg-colour-ballarat 1.47 1.62
bg-colour-bastille 1.29 1.62
bg-colour-bendigo 1.52 1.62
bg-colour-bittern 1.9 3.35, 1.1
bg-colour-bruce 1.39 1.62
bg-colour-bulletin 1.8 1.1
bg-colour-burnley 1.10 3.35, 1.1
bg-colour-central 1.36 1.62
bg-colour-cerg 1.50 1.62
bg-colour-clematis 1.38 1.62
bg-colour-dimboola 1.49 1.62
bg-colour-echuca 1.37 1.62
bg-colour-echuca-root 1.30 1.62
bg-colour-eregnans 1.53 1.62
bg-colour-everton 1.5 3.35, 1.1
bg-colour-everton-root 1.25 1.1
bg-colour-fat-controller 1.12 1.1
bg-colour-flinders 1.58 1.62
bg-colour-garedelyon 1.43 1.62
bg-colour-geelong 1.3 1.1
bg-colour-gwuc 1.14 1.1
bg-colour-gwuc-wiki 1.17 3.35, 1.1
bg-colour-hamilton 1.55 1.62
bg-colour-hawthorn 1.41 1.62
bg-colour-heywood 1.51 1.62
bg-colour-heywood-root 1.27 1.62
bg-colour-jeparit 1.4 3.35, 1.1
bg-colour-kerang 1.11 3.35, 1.1
bg-colour-lilydale 1.57 1.62
bg-colour-meconopsis 1.35 1.62
bg-colour-montparnasse 1.34 1.62
bg-colour-murtoa 1.61 1.62
bg-colour-newport 1.16 3.35, 1.1
bg-colour-newport-root 1.20 1.1
bg-colour-nexus 1.40 1.62
bg-colour-orsay 1.33 1.62
bg-colour-ouyen 1.42 1.62
bg-colour-ouyen-root 1.24
bg-colour-pandorea 1.6 1.1
bg-colour-quorn 1.59 1.62
bg-colour-rainbow 1.45 1.62
bg-colour-redfern 1.32 1.62
bg-colour-reuilly 1.22 3.35, 1.1
bg-colour-reuilly-root 1.15 1.1
bg-colour-richmond 1.46 1.62
bg-colour-richmond-root 1.28 1.62
bg-colour-ringwood 1.48 1.62
bg-colour-sequoia 1.54 1.62
bg-colour-sng 1.44 1.62
bg-colour-spencer 1.2 3.35, 1.1
bg-colour-spencer-root 1.26 1.1
bg-colour-terang 1.13 3.35, 1.1
bg-colour-terang-root 1.23 1.1
bg-colour-wodonga 1.19 1.1
bg-colour-wodonga-root 1.18 1.1
bg-colour-wolseley 1.56 1.62
colours 1.1, 1.62
colours 1.1, 1.62
current date 12.2 3.1, 5.1
current version 12.1 3.1, 5.1
default.bashrc 10.1
determine if primary login 5.9 5.1
determine time zone 3.2 3.1, 5.1
determine where we are 3.4, 3.5, 3.6 3.1, 5.1
determine where we are - expr 3.7
determine who we are 3.3 3.1
do non-root related login things here 3.26 3.8
do root related login things here 3.25 3.8
install on machine X 9.1 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2, 9.2
set LD LIBRARY PATH environment variable 3.30 3.27
set MANPATH environment variable 3.31 3.27
set XMLLIB environment variable 3.32 3.27
set common path for Linux systems 3.22 3.9, 3.9, 3.9, 3.9, 3.9, 3.10, 3.12, 3.14, 3.15, 3.17, 3.18, 3.19, 3.20
set common path for MacOSX systems 3.21 3.9, 3.11, 3.13, 3.23
set env vars for standard MacOSX 3.29 3.27
set env vars for standard linux 3.28 3.27, 3.27
set heading 5.11 5.10
set path for albens 3.10 3.9
set path for bittern 3.11 3.9
set path for burnley 3.14 3.9
set path for cerg 3.12
set path for defaults 3.23 3.9
set path for dimboola 3.13
set path for everton 3.15 3.9
set path for gwuc 3.16
set path for gwuc-wiki 3.20 3.9
set path for newport 3.17 3.9
set path for reuilly 3.18
set path for spencer 3.19 3.9
set paths on all machines 3.9, 3.24 3.8
set paths on all machines 3.9, 3.24 3.8
set python path for MacOSX 3.33
set python path for gwuc-wiki 3.34
set sundry environment variables 3.27 3.8
specific aliases for albens 5.4
specific aliases for gwuc-wiki 5.5 5.3
specific aliases for ubuntu/debian 5.6 5.3
specific aliases for wodonga 5.7 5.3
texrc for MacOSX 6.2 6.1
texrc for non-tex machines 6.4 6.1, 6.1
texrc for ubuntu 6.3 6.1

12.3 Identifiers

Identifier Defined in Used in

13. Document History

15 Dec 1998 John Hurst 1.0 first version to get a version number!
13 Jan 1999 John Hurst 1.0.1 add RSYNC_RSH enviro. .bash_profilenment variable
21 Mar 1999 John Hurst 1.0.2 revise LOGINLVL stuff
02 Jun 1999 John Hurst 1.1 add environment variable SERVER to indicate which X server we have
07 Jun 1999 John Hurst 1.1.1 create file .bash_profile, rather than .profile
16 Jun 1999 John Hurst 1.1.2 add /usr/etc to PATH on indy03
22 Jun 1999 John Hurst 1.2 change to Gnome
23 Jun 1999 John Hurst 1.2.1 for just hawthorn
24 Jun 1999 John Hurst 1.2.2 hawthorn fine tunings
15 Jul 1999 John Hurst 1.3 add .xsession make generator for indy03
03 Aug 1999 John Hurst 1.3.1 add Star Office link on hawthorn
16 Aug 1999 John Hurst 1.3.2 change RSYNC_RSH back to ssh
23 Aug 1999 John Hurst 1.3.3 revise LOGINLVL stuff (again)!
24 Aug 1999 John Hurst 1.3.4 add jade to PATH
20 Sep 1999 John Hurst 1.3.5 add jadetex to TEXINPUTS, ASSOCDB
23 Sep 1999 John Hurst 1.3.6 start an xterm in .xinitrc
27 Sep 1999 John Hurst 1.3.7 updates for changed indy03
12 Dec 1999 John Hurst 1.3.8 PATH and libraries for XML4C2
14 Dec 1999 John Hurst 1.3.9 add XMLLIB environment variable
13 Feb 2000 John Hurst 1.4.0 switch to xlp processing, and remove indy03 references
24 Jun 2000 John Hurst 1.4.1 revise use of horizontal rules
17 Aug 2000 John Hurst 1.4.2 add new central (called junee)
19 Aug 2000 John Hurst 1.4.3 substantial revisions to bring into line with junee
07 Sep 2000 John Hurst 1.4.4 revision icon title of xterm
24 May 2001 John Hurst 1.4.5 (forgot to fill this in!)
21 Jun 2001 John Hurst 1.4.6 remove startup msgs for .bash_profile, .bashrc
06 May 2002 John Hurst 1.4.7 revise \$PATH
09 May 2002 John Hurst 1.4.8 add upload and sync-common, revise \$LOGINLVL setup
21 Jan 2003 John Hurst 1.4.9 add machine colours
20030316:111816 John Hurst 1.4.10 extend and revise machine colours
20040124:164708 John Hurst 1.4.11 remove junee and add meconopsis
20040313:174404 ajh 1.4.12 add colons at end of .texrc initialisations
20040609:094845 ajh 1.4.13 remove window numbering stuff as obsolete
20040904:121839 ajh 1.4.14 add rainbow to list of hosts
20050408:104809 ajh 1.4.15 Add BALLARAT environment variable
20050409:140618 ajh 1.4.16 Add ARARAT environment variable
20050504:102025 ajh 1.4.17 move BALLARAT ARARAT settings to separate file
20050725:131418 ajh 1.4.18 add setup for dhcp7-218 (Swinburne). Fixed .texrc error with new texmf structure.
20060410:094906 ajh 1.4.19 added new laptop murtoa (MacBook Pro)
20061209:115828 ajh 1.5.0 add ajh.id.au/njhurst.com/sequoia machine
20070417:154051 ajh 1.5.1 add clematis machine
20070417:163223 ajh 1.5.2 cleaned up some obsolete code (.xinitrc, etc.)
20080305:084924 ajh 1.5.3 added bsit-roaming site
20080312:092253 ajh 1.5.4 revised dyn- hostnames to not include any IP component
20090305:101021 ajh 1.5.5 revised new colour scheme for murtoa
20090306:095359 ajh 1.6.0 split out colour setting as separate file
20090409:144431 ajh 1.6.1 added 'roaming-*' to hostnames
20100226:094026 ajh 1.7.0 added eregnans to list of machines
20100603:163502 ajh 1.8.0 added new laptop bittern (MacBook Pro)
20101213:170646 ajh 1.8.1 redo hostname to use -s flag
20110930:143945 ajh 1.8.2 minor updates for eregnans
20120511:150428 ajh 1.8.3 further minor updates for eregnans
20120516:095927 ajh 1.8.4 separate out the PYTHONPATH environment variable setup
20120521:172501 ajh 1.8.5 added ringwood colour
20140221:162453 ajh 1.8.6 remove all references to the PILOT personal digital assistant, and the hawthorn system
20151220:164204 ajh 1.8.7 add albens, replacing ararat
20151223:135920 ajh 1.8.8 add auteuil, and remove several redundant machines
20160321:222440 ajh 1.8.9 add spencer
20170201:145150 ajh 1.8.10 add in.gwuc.org.au, remove flinders
20170202:125827 ajh 1.8.11 remove eregnans, add gwuc-wiki
20180115:131934 ajh 1.9.0 improve parametization of setup
20180705:151528 ajh 1.9.1 add burnley
20200426:214029 ajh 1.9.2 add kerang, and clean up decommissioned machines
20200826:163949 ajh 1.9.3 add ouyen
20210603:172145 ajh 1.9.4 add machines terang and jeparit
20210914:101449 ajh 1.9.5 remove ouyen, in.gwuc.org.au
20221130:101144 ajh 1.9.6 add ~/Applications to newport path
20240402:091059 ajh 1.9.7 add machines wodonga and albury, remove sync-common

<current version 12.1> = 1.9.7
Chunk referenced in 3.1 5.1
<current date 12.2> = 20240402:091059
Chunk referenced in 3.1 5.1