We help IT Professionals succeed at work.

profile for ksh

lolaferrari
lolaferrari asked
on
if the shell of an account is set to use ksh but when you login you only have profiles for .bashrc and .bash_profile you have to create a profile for using ksh unless of course you change which shell your account is supposed to use. why do you have to use a .profile and a .kshrc and call the .kshrc in the .profile ?
Comment
Watch Question

Commented:
Are you asking for the difference between .profile and .kshrc?  If so (from http://osr600doc.sco.com/en/USE_oview/Your_environment.html)

The difference between .profile and .kshrc, and between .login and .cshrc, is in when the files are read. The .profile and the .login are only read when you log in. However, the .rc files, .kshrc and .cshrc, are read each time you start a ksh or csh. (You can start a shell from the command line by typing the name of the shell just like you would type any command.)
CERTIFIED EXPERT

Commented:
Each shell is a different language and so it is logical to keep separate profile files for them.
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
AIX uses ksh by default.

To make the arrow keys work you must have the following aliases defined:

alias __A=$(echo "\020")   # up arrow = ^p
alias __B=$(echo "\016")   # down arrow = ^n
alias __C=$(echo "\006")   # right arrow = ^f
alias __D=$(echo "\002")   # left arrow = ^b

Set these aliases in /etc/profile or your personal .profile and add

set -o emacs

to the respective file, and logout and re-login.

wmp
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
Sorry, wrong thread!
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013
Commented:
You don't need .profile and .kshrc, .profile alone is sufficient.

You can create a .kshrc file in your HOME and enable it in .profile with

export ENV=~/.kshrc

This will make the settings in .kshrc active in non-login shells, started e.g. by entering "ksh" on the command line.

wmp



Explore More ContentExplore courses, solutions, and other research materials related to this topic.