Cover V05, I04
Article
Listing 1
Listing 2

apr96.tar


Listing 1: .profile

#
# .profile
# March 29 1995 - Russ Hill
#
# This shell script is executed once per login.
# * It is executed by the OS when logging into a UNIX console
# * Put only commands you wish to executed once
#
# Notes to user:
#   1) Comment lines are designated by '#'
#   2) You CAN have blank lines in this file


# Initialize "TERM" variable
#   The line sets terminal type to "xterm" as default
#   To set terminal type to "vt100", change "xterm" to "vt100"
#   To have terminal ask before setting, add a "?" in front of ":"
#     (i.e.  -m ':vt100'  ->  -m '?:vt100')
#eval $(/usr/ucb/tset -e -r -S -Q -m 'console:vt100' -m 'network:?vt100' -m ':vt100')
eval $(tset -e^h -k^u -r -S -Q -m 'console:xterm' -m 'network:?xterm' -m ':xterm')
#eval $(/usr/ucb/tset -e^? -k^u -r -S -Q -m 'console:vt100' -m 'network:?vt100' -m
':vt100')
#eval $(/usr/ucb/tset -e -r -S -Q -m 'console:xterm' -m 'network:?xterm' -m ':xterm')


# Initialize HOSTNAME variable
#      HOSTNAME is used by this shell script and by applications to designate
#      what machine you are logged on to
PATH=$PATH:/usr/bin:/bin:/usr/ucb    #Temporarily expand PATH -- Don't Modify
if [ "X${DISPLAY}" = "X" ]
then
export HOSTNAME=$(hostname)           #consoles
else
#export HOSTNAME=${DISPLAY%:0.0}
export HOSTNAME=${DISPLAY%:0*}        #xterminals
fi
#export HOSTNAME=$(hostname)


# Initialize DISPLAY and MACHINE variable
#   DISPLAY represents the display you are using.
#   MACHINE represents the type of UNIX box you are using.
export DISPLAY=${HOSTNAME}":0.0"
#export DISPLAY=`who am i -R | awk -F'.' '{print $1}' | awk '{print
substr($6,2,length($6)-1) ":0.0"}'`
#export DISPLAY=`who am i | tr -d '()' |awk -F'.' '{print $1}' | awk '{print $6 ":0.0" }'  `
#export DISPLAY="casper:0.0"

export MACHINE=`uname -s`

# Initialize PATHs and MANPATH
#   Initialize PATH variable
#     lpath is the "local path" that you can change.
#     apath is the "application path" that you can change.
#     You do not have to put the current (".") directory in these
#     variables, it is specified in main PATH declaration.
#   Initialize MANPATH
#     MANPATH defines the search path for manual pages with the 'man'
#     command.


lpath=${HOME}/bin		# local path

case $MACHINE in

'HP-UX') # HP PATHs

#apath applications path -- you can change this line
apath=/usr/contrib/mitX11R5/bin:/opt/lrom/bin

# DO NOT CHANGE THE "PATH" DECLARATION BELOW!!!!
export
PATH=/usr/local/bin:/usr/sbin:/bin:/usr/bin:/etc:/usr/etc:/opt/ansic/bin:/usr/ccs/bin:/usr/co
ntrib/bin:/opt/nettladm/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/langtools/bin:/opt/imak
e/bin:/sbin:/usr/vue/bin:${apath}:${lpath}:.:

# change lmanpath line only   # local manpath
lmanpath=/usr/local/man:/usr/contrib/mitX11R5/man

# DO NOT CHANGE THIS LINE!!!  Sets MANPATH for locations of manual pages
export
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/u
sr/local/man/%L:/usr/local/man:/opt/blinklink/share/man:/opt/ansic/share/man/%L:/opt/a
nsic/share/man:/opt/langtools/share/man/%L:/opt/langtools/share/man:/opt/imake/man:/o
pt/audio/share/man:/opt/image/share/man

;;
'SunOS') # Sun PATHs

# apath applications path -- you can change this line
apath=/opt/SUNWspro/bin:/opt/gnu/bin:/usr/contrib/bin

# DO NOT CHANGE THE "PATH" DECLARATION BELOW!!!!
export
PATH=/usr/local/bin:/sbin:/bin:/usr/ucb:/usr/bin:/usr/sbin:/usr/etc:/usr/ccs/bin:/etc:/opt/v
xva/bin:/var/nis:/usr/openwin/bin:${apath}:${lpath}:.:

# change lmanpath line only   # local manpath
lmanpath=/usr/local/man

# DO NOT CHANGE THIS LINE!!!  Sets MANPATH for locations of manual pages
export MANPATH=/usr/man:/usr/openwin/man:${lmanpath} # set manpath

;;
'AIX') # AIX PATHs

# apath applications path -- you can change this line
apath=/usr/contrib/bin

# DO NOT CHANGE THE "PATH" DECLARATION BELOW!!!!
export
PATH=/usr/local/bin:/sbin:/bin:/usr/ucb:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/bin/X11:${ap
ath}:${lpath}:.:

# change lmanpath line only   # local manpath
lmanpath=/usr/local/man

# DO NOT CHANGE THIS LINE!!!  Sets MANPATH for locations of manual pages
export MANPATH=/usr/man:/usr/share/man:${lmanpath} # set manpath
;;
esac

#   Initialize CDPATH
#     CDPATH defines the search path for "cd" built-in directories.
#     Having built-in directories gives you the capability to "cd" to
#     a predefined directory.  Default is "~/bin" directory.
#         example: cd /etc    # goes to /etc directory
#                  cd bin     # goes to $HOME/bin
#     Change this line only
lcp=${HOME}:${HOME}/bin:			# local cd path

#     DO NOT CHANGE THIS LINE!!!  Sets CDPATH <current>,
#       <user specified>, then <parent> directory.
export CDPATH=.:${lcp}..:			# set CDPATH

#   Initialize FPATH
#     FPATH defines the search path for auto-load functions.
#     These are functions that you define in ksh.
lfp=:${HOME}/bin:				# local function path

#     DO NOT CHANGE THIS LINE!!!  Sets FPATH to <function> directory
#       then <current> directory.
export FPATH=${lfp}.:				# set FPATH

# Initialize ENV variable
#   ENV defines the user environment file (shell script) that will
#   be executed when "ksh" is invoked.  The default for
#   this variable is ".kshrc"
export ENV=${HOME}/.kshrc				# environment file

# Initialize default printer
export LPDEST=lp0
export PRINTER=lp0

# Initialize tpm
#tpm -s 6400 5120
#tpm -s 1280 1024  # default


# Initialize ksh Command Line editors (EDITOR, FCEDIT, VISUAL)
# This is where your COMMAND LINE Editing functionality is setup.
# For more information about COMMAND LINE Editing, please refer to
# the "Command Re-entry" section of the ksh man page (man ksh).
# Variables needed to be setup are:
#    EDITOR defines default editor used for some UNIX applications (i.e. mail)
#    FCEDIT defines editor used for ksh "fc" function (history)
#    VISUAL defines visual editor used for some UNIX applications
# If change default editor (vi) to emacs, then be sure to change .kshrc
# file section on Command Line editing

#   For TERM="xterm" or "vt100"
#     This sets up command line editing for all other "normal" windows.
#     You can choose between "vi" or "emacs".  To change to "emacs",
#     change "vi" in both lines to "emacs".  default is "vi"
#     like command editing.
if [ "${TERM%%_*}" = "xterm" -o "${TERM%%_*}" ="vt100" ];
then
set -o vi					# Command Line set to "vi"
export EDITOR=$(whence vi)			# default
export FCEDIT=$(whence vi)			# editor for fc
export VISUAL=$(whence vi)			# visual editor

#     set +o vi					# Command Line editing off
#     export EDITOR=$(whence vi)		# default (vi)
#     export FCEDIT=pad				# editor for fc
#     unset VISUAL				# visual editor

#     set -o emacs				# Command Line set to "emacs"
#     export EDITOR=$(whence emacs)
#     export EDITOR=$(whence xemacs)            # xemacs
#     export FCEDIT=$(whence emacs)
#     export VISUAL=$(whence emacs)

fi

#   Initialize HISFILE (history file) & HISTSIZE (history size)
#     Change HISTFILE if you do not want your history kept in .kshist
#     (default).  Change HISTSIZE if you want more (or less)
#     commands kept in your command history log (100 is default).
export HISTFILE=${HOME}/.kshist			# history file
#export HISTFILE=/usr/tmp/.kshist.${LOGNAME}	# history file
export HISTSIZE=100				# history size


# Initialize Command line Prompts
#   You may want to change PS1 only.  The default is to print HOSTNAME
#   with command number.  See "paramters used by the ksh" in ksh man
#   page (man ksh) for more information.
export PS1="<${HOSTNAME}> !$ "			# primary prompt
#export PS1="<${HOSTNAME}>:\${PWD} !$ "		# primary prompt
#export PS1='<${PWD#$HOME/}:!>$ '               # primary prompt
#export PS1='[${PWD#$HOME/}:!]$ '               # primary prompt
#export PS1='$ '                                # primary prompt
#export PS1='$PWD !]$ '                         # primary prompt
#export PS1="${HOSTNAME}> "                     # primary prompt
export PS2=">"					# secondary prompt
export PS3="#"					# select prompt
export PS4="+"					# debug prompt


# Initialize EXINIT variable
#   EXINIT is used by vi/ex/ed to set initial editing environment
#   Comment out this line if you wish to use the ".exrc" file
#   to initialize vi/ex/ed edit session
export EXINIT='set sw=2 ai'			# ex setup


# Initialize Gnu Emacs variables
#   Used in Gnu Emacs application
#export EMACSLOADPATH=/usr/local/gnuemacs/lisp # gnu load path

# Initialize NNTPSERVER for 'tin' and 'trn' applications
#export NNTPSERVER=fatso
#


# Initialize PAGER variable
#   PAGER defines which file display routine you will use in certain
#   UNIX applications.  default is "more".
export PAGER=$(whence more)			# pager
#export PAGER=$(whence less)
#export LESS="-i -M"
#export LESS="-b10 -P--Less--(%pb\%) %f"


# The following variables where set previously and shouldn't be changed.
#export HOME					# home directory
#export LINES					# display lines
#export COLUMNS					# display columns
#export ISP					# cpu type
#export LOGNAME					# logname
#export MAIL					# mail filename
#export NODEID					# node id
#export NODETYPE				# node type
#export ORGANIZATION				# organization
#export PROJECT					# project name
#export SHELL					# shell filename
#export SYSTYPE					# system type
#export TERMCAP					# termcap definition
#export USER					# username
#export X					# is X installed here?

# Initialize Miscellaneous Environment Variables
#export WINEDITOR=emacsclient
#export ILEAF_HOME='/usr/local/ileaf/bin'
#export SWINHOME=/usr/local/SoftWindows
#LM_LICENSE_FILE=${LM_LICENSE_FILE}:/usr/local/ileaf/data/license/license.dat


# Start GUI interface.
case $MACHINE in

'SunOS')
if [ "X${MACHINE}" = "XSunOS" -a `tty` = "/dev/console" ]
then

if [ ${OPENWINHOME:-""} = "" ] ; then
export OPENWINHOME=/usr/openwin
export
LD_LIBRARY_PATH=/opt/SUNWspro/lib:$OPENWINHOME/lib:$LD_LIBRARY_PATH

fi

echo ""
echo "Starting OpenWindows in 5 seconds (type Control-C to interrupt)"
sleep 5
echo ""

# Start Xwindows (startx) or OpenWindows (openwin)
openwin
#startx

clear           # get rid of annoying cursor rectangle
exit            # logout after leaving windows system
fi
;;
'AIX')

TERMTYPE=`tty | grep hft`
if [ -n "$TERMTYPE" -o -n "$XSTATION" ]
then
if [ -f /usr/lpp/X11/bin/startx ]
then
/usr/lpp/X11/bin/startx
fi
fi
;;
esac

# End of File