Category Archives: unix

Use your arrow keys in AIX KSH

  • login as root
  • open /root/.kshrc (change /root in caes you change the home dir of root)
  • add the following

set -o emacs
alias __A=`echo “20”`     # up arrow = ^p = back a command
alias __B=`echo “16”`     # down arrow = ^n = down a command
alias __C=`echo “06”`     # right arrow = ^f = forward a character
alias __D=`echo “02”`     # left arrow = ^b = back a character
alias __H=`echo “01”`     # home = ^a = start of line
alias __Y=`echo “05”`     # end = ^e = end of line

  • save the file
  • logout
  • login and you can make use of the arrow keys

Korn Shell

enable TAB completion : set -o viraw (or use set -o vi, works on my redhat enterprise 5.7)

prompt formatting : PS1='[$USER@$HOSTNAME]:${PWD#${PWD%/*/*}/} # ‘

http://osr507doc.sco.com/en/OSUserG/_The_Korn_shell_profile_and_kshrc.html