Cover V05, I04
Article
Listing 1
Listing 2

apr96.tar


Listing 2: .kshrc

#
# .kshrc
# March 29 1995 - Russ Hill
#
#
# This shell script is executed everytime ksh starts up
# (i.e. every window (xterm) created, every ksh script run)
# Put only commands here you wish to be executed each time ksh starts up.
# Include aliases here (in the INTERACTIVE section)
#
# Notes to user:
#   1) Comment lines are designated by '#'
#   2) You CAN have blank lines in this file

# Initialize Permissions Mask
#   This sets up the default permissions mask for all new files created
#   This setting is here (rather than .profile) because you may change
#   the setting in another window, which causes problems for future
#   windows (environments) during a single login.
#   default is 775: user=read,write,execute; group=read,write,execute;
#                        world=read,execute
umask 002    #default
#umask 022


# Initialize as per type of shell invoked
case $- in
*i*) # INTERACTIVE SHELL (via xterm, login, etc)

#############################
#############################
## INTERACTIVE SHELL SETUP ##
#############################
#############################

clear


###########################################

# USER KSH ALIASES FOR INTERACTIVE SHELLS #
###########################################

alias cp='/bin/cp -i'         # ask before clobbering copy
alias copy='/bin/cp -i'       # DOS alias for cp
#alias cd='cd; pwd'           # change dir and show location


alias cls='clear screen'      # clear screen
alias c='clear'               # clear screen

alias mv='/bin/mv -i'         # ask before move/rename
alias rename='/bin/mv -i'     # DOS alias for mv (rename)

alias rm='/bin/rm -i'         # ask before remove
alias del='/bin/rm -i'        # DOS alias for rm

alias h='history'             # display history

alias home='cd ~'             # quick cd to home directory
alias up='cd ..'              # quick cd to previous directory
alias back='cd -'             # quick cd to previous directory

alias ls='/bin/ls '           # Normal ls
alias lsa='/bin/ls -a'        # Normal ls - gives .* files quickly
alias lst='/bin/ls -at'       # ls (w/.* , sorted by mod time)
alias ll='/bin/ls -la'        # Long version of ls
alias llt='/bin/ls -alt'      # Long ls (w/sorted by mod time)
alias lg='/bin/ls -lag'       # Longest version of ls (w/groups)
alias lx='/bin/ls -lagF'      # This ls gives everything (slowest)
alias lf='/bin/ls -aF'        # ls (w/file flag char)
alias lft='/bin/ls -aFt'      # ls (w/file flag char,time sorted)
alias dir='/bin/ls -al'       # DOS alias for ls
alias psa='ps -ef'            # Display all processes

alias j='jobs -l'             # quick type to show background jobs
alias x='/bin/chmod +x'       # quick add execute permission

alias help='man -k'           # quick for man page search
alias key='man -k'            # quick for man page search

alias zgrep='zgrep -i'        # Case-insensitive grep for .Z files

alias bye='exit'              # logout
alias logout='exit'           # logout
alias adios='exit'            # logout

alias fg-='fg %-'


alias u='unalias'

alias __A=^P
alias __B=^N
alias __C=^F
alias __D=^B



case $MACHINE in

'HP-UX') # HP

alias rsh='remsh'             # remsh SYSV, rsh is BSD
alias df='bdf'                # bsd df

;;
'SunOS') # Sun

alias df='df -k'              # bsd df
alias cc='/opt/SUNWspro/bin/cc' # cc
;;
'AIX') # Sun

alias df='df -k'              # bsd df
;;
esac



# ksh aliases setup automatically by ksh
# listed here for information purposes only
# see ksh man page (man ksh) for more information
#     false='let 0'
#     functions='typeset -f'
#     history='fc -l'
#     integer='typeset -i'
#     nohup='let 0'
#     r='fc -e -'
#     true=':'
#     type='whence -v'
#     hash='alias -t'

# Initialize COMMAND LINE Editors
#   Reset here in case mis-set in some other window
#   Change "vi" to "emacs" if emacs is desired
set -o vi             # default (vi)
#  set -o emacs


# Initialize other environment parameters
#   defaults are in () - (set) means uncommented
#                             (unset) means commented
#   For more information, set ksh man page

# set -o allexport    # automatic export during variable assignment
# set -o bgnice       # set all background (&) to run
#   at an lower priority
# set -o ignoreeof    # ignore ^D (have to type 'exit'
#    to kill window)
# set -o noglob       # disable filename generation/pathname
#   expansion (unset)
# set -o nolog        # don't store function defs in history
# set -o markdirs     # append / to all directory expansions
set -o monitor        # monitor background jobs (set)
# set -o verbose      # print shell input lines as they are
#   read - used to debug scripts (unset)
set -o trackall       # track all commands (set)
# set -o xtrace       # print shell input lines as they are
#   executed - used to debug scripts (unset)
# set -u              # gives error when unset variables
#   are used - used to debug scripts (unset)

;;


*) # NON-INTERACTIVE SHELL (via ksh shell script, program, etc)

#################################
#################################
## NON-INTERACTIVE SHELL SETUP ##
#################################
#################################

# Initialize other environment parameters
#   For more information, set ksh man page


# set -o allexport    # automatic export durint variable assignment
# set -o bgnice       # set all background (&) to run
#   at an lower priority
# set -o noglob       # disable filename generation/pathname
#   expansion (unset)
# set -o nolog        # don't store function defs in history
# set -o markdirs     # append / to all directory expansions
# set -o verbose      # print shell input lines as they are
#   read - used to debug scripts (unset)
set -o trackall       # track all commands (set)
# set -o xtrace       # print shell input lines as they are
#   executed - used to debug scripts (unset)
# set -u              # gives error when unset variables

;;
esac

#End of File