First, do not mess with
/etc/profile, just leave it alone (your next system update will overwrite whatever you have done in
/etc/profile).
You can create a ~/.
profile, ~/.
kshrc and ~/.
exrc in your home directory and add whatever is needed there.
Check to see if you have an
/etc/profile.d directory; if you do, you can profile instructions there. If not, then you'll be adding one or more of the above files in your home directory.
Let's say you want to invoke function keys (I'm assuming you want the command line editing keys?): here's the way to do that
Code:
# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
# VISUAL=emacs # ugh
# VISUAL=gmacs # double ugh
VISUAL=vi # ah, elegance
fi
That's part of my
/etc/profile.d/ksh.sh file (do not create one of those if you don't have the
profile.d directory, put that in your
~/.profile file).
The order of execution with when you log in is
- /etc/profile
- /etc/profile.d < if it exists on your system by default >
- ~/.profle
Those files are plain text, owned by "you," not executable.
My
~/.kshrc file looks like this:
Code:
alias lc='/usr/bin/clear; /bin/ls ${LS_OPTIONS} -aCF'
alias ll='/bin/ls ${LS_OPTIONS} -al'
alias cls='clear'
alias hi='history -${LINES}'
alias rs='eval `resize`'
fubar-trona-/home/trona: cat .kshrc
alias lc='/usr/bin/clear; /bin/ls ${LS_OPTIONS} -aCF'
alias ll='/bin/ls ${LS_OPTIONS} -al'
alias cls='clear'
alias hi='history -${LINES}'
alias rs='eval `resize`'
My
~/.exrc file looks like this:
Code:
# Set options for vi
set autoindent showmode showmatch
In your ~/.profile file you'll need to add appropriate lines to execute the KornShell options:
Code:
# set up default columns and lines
COLUMNS=80
LINES=40
export COLUMNS LINES
# set up default group
GRPNAME=`groups | cut -d' ' -f1`
export GRPNAME
# set up a good-size history
HISTSIZE=1000
export HISTSIZE
# set up the ksh environment
ENV=${HOME}/.kshrc
export ENV
# set up CVSROOT
CVSROOT=:pserver:trona@fubar.lan:/usr/local/cvsroot
export CVSROOT
# change the PATH a little
export PATH=.:${HOME}/bin:${PATH}
export INSTALL_BASE=${HOME}
export LLDATABASES=${HOME}/LifeLines:.
export LLPROGRAMS=.:/usr/local/share/lifelines
# make COLUMNS and LINES the screen size
eval `resize`
The only line you would need in
~/.profile is
Code:
# set up the ksh environment
ENV=${HOME}/.kshrc
the rest of it is just for fun and setting things the way I want them.
Finally, you will need to edit whatever "terminal" you use so that it is a log in terminal. If you don't, you'll get a plain Jane default terminal. All of the terminal emulators have a way to check a box to make them log in terminals.
Hope this helps some.