Start up files for ksh – The Korn shell .profile and .kshrc

Posted by Jiltin     27 April, 2009    8,645 views   

The Korn shell (see ksh(1)) uses two startup files that allow users to customize their shell environment: a $HOME/.profile (if one exists) and the startup file specified by the ENV environment variable (if set and exported). Typically, $HOME/.kshrc is the file name used as the value of the ENV variable, however the startup file for ksh can be named any valid file name and is not constrained to be .kshrc. .kshrc is not a startup file hardcoded into ksh, but rather a common name that is used for the ksh startup file specified (optionally) by the ENV environment variable in the users environment.

The .profile is read once, by your login ksh. The ENV file is read by each invocation of ksh, if ENV is defined in the current environment. Typically, users define ENV in their .profile file, and then this variable is available to all future child shells (unless ENV is unset).

Here is the sample code

# .profile      — Commands executed by a login Korn shell
#
# Copyright (c) 1990-1998 The Santa Cruz Operation, Inc.
# All rights reserved.
#
# This Module contains Proprietary Information of the Santa Cruz
# Operation, Inc., and should be treated as Confidential.
#
PATH=$PATH:$HOME/bin:.                  # set command search path
export PATH
if [ -z "$LOGNAME" ]; then
        LOGNAME=`logname`               # name of user who logged in
        export LOGNAME
fi

MAIL=/usr/spool/mail/$LOGNAME           # mailbox location
export MAIL
if [ -z "$PWD" ]; then
        PWD=$HOME                       # assumes initial cwd is HOME
        export PWD
fi
if [ -f $HOME/.kshrc -a -r $HOME/.kshrc ]; then
        ENV=$HOME/.kshrc                # set ENV if there is an rc file
        export ENV
fi
# use default system file creation mask (umask)
eval `tset -m ansi:ansi -m $TERM :? ${TERM:-ansi} -r -s -Q`
# If job control is enabled, set the suspend character to ^Z (control-z):
case $- in
*m*)    stty susp ‘^z’
        ;;
esac
set -o ignoreeof                        # don‘t let control-d logout
case $LOGNAME in                        # include command number in prompt
root)   PS1="!# " ;;
*)      PS1="!$ " ;;
esac
export PS1

Another simple sample file: A typical .kshrc might look like this

# .kshrc        — Commands executed by each Korn shell at startup
#
#       @(#) kshrc 1.1 90/03/13
#
# Copyright (c) 1990-1998 The Santa Cruz Operation, Inc.
# All rights reserved.
#
# This Module contains Proprietary Information of the Santa Cruz
# Operation, Inc., and should be treated as Confidential.
#
# If there is no VISUAL or EDITOR to deduce the desired edit
#  mode from, assume vi(C)-style command line editing.
if [ -z "$VISUAL" -a -z "$EDITOR" ]; then
        set -o vi
fi

Following Google Searches Lead To This Post: example of local.profile in kshell on Solaris 10
example of .profile .kshrc in Solaris 10
.kshrc file
changing user shell on UNIX in .profile
example for PS1 in kshell in Solaris 10
.profile scripting ksh source
ksh .profile oracle
ksh .profile oracle linux
classic ksh scripting
ksh .profile oracle linux username
how is ksh ENV file read
linux coloring the ksh prompt
what does ksh run at startup
cool linux shell initialization scripts ksh korn
ansi colors aix
setting up term kshrc
solaris ksh shell time to live
ksh does not read .profile AIX
ksh rc ssh
how to unset a sourced profile
unix ksh shell startup
ksh .kshrc
customizing ksh profile
ksh profile for oracle on Linux
change bourne shell profile to KSH
setup unix bourne shell to start ksh profile
ksh login sequence
Which file does the Korn shell read at startup in UNIX?
ksh profile ps1
change font color in kshrc
ksh settings
ssh ksh PATH
ksh load environments from a file
commands .kshrc
korn shell .profile usrname in prompt
AIX .kshrc
.kshrc email
UNIX .kshrc file samples
sample .profile solaris
what is solaris ‘/etc/env’ file ksh
unix shell ksh profile change command line
cron jobs on LInux kornshell
passing $ in ksh profile
ksh color linux
customize ksh profile
password for ssh in korn shell script
ksh profile unix colors
how to set up profile in kshell unix
color “korn shell” prompt path
.profile not working in ksh
how to execute a command in aix in startup
aix dircolors
text coloring within screen ksh
running .profile file in ksh
ksh profile file
solaris PS1 color
kshrc prompt
ksh profile term
korn shell .kshrc Ps1 customize
sourcing a UNIX startup file
how to source a file in ksh
ksh source rc
coloured prompt of korn shell + script
ksh sourcing in a .profile
customise korn shell colors
ksh PS1 path
ksh PS! newline
ksh change colour
ksh prompt color
aix ksh root environment
unix PS1 customize korn
korn shell coloring
unix colour for prompt solaris profile
solaris korn shell PS1=$pwd
solaris korn shell PS1=
setting DISPLAY in kshrc script
aix shell script ansi colour
Solaris ksh include
source .kshrc from a script
solaris ksh login sequence
.kshrc linux setup
solaris 10 change korn to bash
the ksh script to change color in AIX
kshrc profile path
call .kshrc from profile
$? sample in ksh unix
source profile + AIX
customise shell prompt ksh
is .profile file is only for ksh
ksh profile
ksh login order
ksh load profile
.profile path ksh
examples of unix .kshrc
customize shell prompt ksh root
ksh init file
unix set kshrc commands
Solaris 10 root profile ksh
unix init file ksh
configure korn shell kshrc
sample profile kshrc
unix .profile PS1 coloring
ksh .profile PS1 Color How to
customize korn shell
Korn shell environment file
“solaris 10″ cron ksh
ksh .profile root
what is the korn shell environment file
sample “.login” file + ksh
how to set .kshrc file
how to set user profiles in ksh + unix
scrip login kshrc solaris
regular expressions kshell aix example rename file
run ./ kshrc file
ksh .profile linux
solaris ksh login profile file sourcing
kshrc set editor in unix in env
ksh customize
run profile + ksh
source ksh file .profile
.kshrc file PS1
sample kshrc
set newline in ps1 for ksh
how to source .kshrc file
solaris .profile PS1
execute command .kshrc
how to start ksh script
how to use .env file in ksh
korn shell PS1 solaris
PS1 oracle shell
solaris kshrc
ksh environment file
unix .profile ksh pwd
linux ksh path setting .kshrc
ksh startup scripts in solaris
colorate shell aix ksh
korn shell environment variable source
color prompt ksh
source in .profile aix
colors.ksh
linux script ksh “new shell”
aix shell startup files
kshrc startup file solaris
kshrc get current display
setting color prompt in ksh
solaris .kshrc sample
start ksh in .profile
config file for korn shell
startup file of ksh in unix
to add an environment variable in .kshrc
ksh .profile sample
enable colour in korn shell on aix
set prompt ksh .profile
path of .kshrc file in unix
which configuration file does ksh read
korn shell .kshrc examples
kshell:include files
ksh ${prompt:q}
linux .kshrc file
how to read a config file in Korn shell
.kshrc source script
login unix .profile korn file
ksh profile PWD
source profile in korn shell +AIX
export ksh
ksh include script
aix ksh .kshrc
sample .kshrc file
set ksh environment
set path solaris ksh user profile
colored file in korn shell
.profile file and kshrc
AIX ENV kshrc
ksh color prompt how to
shell environment crontab ksh
korn shell color prompt
file listing in color in korn shell
ksh .profile .kshrc
KSH startup PS1
profile oracle ksh
.profile file in unix
korn shell profile not sourced
UNIX ksh source the profile
list of korn shell colors
ksh scripts default kshrc
ksh cron profile environment variables
Editing a .kshrc file in Unix
aix ksh command prompt control character
vi ksh color codes
color shell script aix
ksh profile PS
to execute ksh in new prompt
source setup file in ksh
how to set up profile stty “how to set up .profile ”
set up solaris 10 .profile file
PS1 korn shell examples
Linux korn shell startup files
ksh include php
load env in solaris
create a .kshrc file
AIX create .kshrc
ksh initialisation files and startup at unix
unix job control Stty susp ^F
ksh .profile example
example .kshrc
startup file of ksh
example .kshrc and .profile oracle
to find ip config in ksh sheell of linux
“solaris 10″ “korn shell”
include files in korn shell script
ksh profile linux
ksh startup file
define oracle path korn
ksh PWD
how to edit line in the shell startup file on aix
kshrc ps1 pwd
ksh profile files
ksh include file
edit .profile unix korn
what is .kshrc
change to ksh linux
shell profile AIX
ksh environment variable
ksh profile kshrc
sample ksh file
linux ksh color
aix ksh color support
customize ksh
how to set font color + solaris10 shell
how to run .profile file in oracle
ksh profile kshrc PS1 PWD
solair ksh profile not exported
.profile set ksh
.kshrc bash like
Korn shell .profile
unix shell prompt ksh newline
profile file to set ps1 in solaris
ksh script not sourcing profile kshrc
ksh config
ksh “solaris 10″ shell
edit unix profile in ksh
unix k shell startup files
ksh path solaris apply .profile
korn shell, font
korn oracle
call files from .kshrc
sample profile kshrc solaris oracle
ssh ksh profile
Unix + where to set user profiles in ksh
ksh profile startup
where is ksh file locate in linux
korn shell configuration
what is the default profile file for kshell
unix startup files profile
ksh profile solaris
aix profile does not source
ksh PS1 default
.profile ksh color
ksh environment rc
ksh different profile file
ksh .profile ps1
sample profile file in unix
korn samples
solaris .profile ksh example
korn shell init files
korn shell init ENV
ksh profile on solaris
ksh environment files
solaris export $PATH unix .profile .kshrc
ksh user profile file
default profile for ksh
ksh ps1 variablen
files that are required to configure kshell in solaris 10
execute command another user load profile unix
ksh is not reading .kshrc
solaris 10 .profile kshrc
cool .kshrc
AIX root profile sample
korn shell startup file
Solaris 10 sample root .profile ksh
default shell in solaris kshrc
initialization files for ksh+unix
startup files for ksh shell in solaries 10
korn startup files
linux setup kshrc PWD
what is .kshrc?
kshrc “solaris 10″
export .env and .profile from korn script
how to run commands .kshrc
ksh setting
aix kshrc
unix “solaris 10″ LOGNAME not set
Ksh vs bash initialization files kshrc
korn shell initialization file list
korn shellin configuration files
.profile file is not read in ksh
AIX login ksh .profile .kshrc
configurer le prompt ksh
korn shell kshrc
set up .kshrc file
how to set up korn shell
solaris 10 set shell bash or korn .profile
ksh load env from file during execution
ksh initial file
solaris .profile ksh +colors
execute .kshrc .profile ksh start
aix commands to load profile
solaris 10 ksh
aix startup environment files
ksh profile not loaded env
ksh profile not loaded env aix
cron korn shell path
call ksh with .profile
ksh ps1 profile
ksh case example
ksh initialisation files
useful korn shell profile
where is .kshrc
ksh+startup+shell+unix+file
seeting up the ksh .profile in linux
sample “.kshrc” color
howto unset ksh
aix PS1 ansi*
kshrc sample file
solaris ksh startup file
aix kshrc profile
korn shell with oracle
oracle startup .kshrc
color files ksh
unix ksh .kshrc
sourcing a file in ksh
ksh.rc
kshrc .profile order of execution flow unix
linux korn-shell setup files
.profile .login .kshrc bash
unix ksh load parameters from file
aix ansi colour
korn shell colour prompt
aix .kshrc vi
kshrc not loaded
Start.ksh
.profile not loaded aix
AIX .profile prompt color
what to customize in .profile korn shell UNIX
how to run ksh on solaris10
korn time shell prompt solaris
aix ksh change font color
ssh ksh kshrc
configure local initializaton file for ksh in aix
how to read a different profile on start ksh
+ksh +linux ~customize
colors set ksh
how to set ksh shell profile for oracle
unix startup files and export
i cant find .profile and .kshrc in solaris 10
add the PATH, ..profile, UNIX, korn
run .profile from .kshrc
what is kshrc on unix
solaris 10 .kshrc
aix LOGNAME readonly
my own ksh profile linux
.kshrc color
“shell startup file” oracle where
kshrc example
shell scripting adding colors + AIX + ksh
customizing unix korn shell profile
linux profile ksh
unix how to start ksh on logon
ksh ssh load path environment
kshrc like bash
korn shell PS1 color
ksh shell profile hostname
bash pass environment to ksh
bash aus .kshrc starten
solaris 10 kshrc ENV
.kshrc file in solaris
configuration .profile ksh color
start ksh without profile
setting up a ksh account
change aix .profile colour
change AIX prompt colour
linux korn PS1 colors
linux path kshrc
ksh kshrc
ksh startup files
.kshrc file in unix

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Unix Tags : ,

Comments

No comments yet.


Leave a comment

(required)

(required)