| ksh command history |
[Sep. 23rd, 2008|11:49 am] |
#get ksh from http://www.research.att.com/~gsf/download/ #http://www.kornshell.com/info/ # "The new version of ksh has the functionality of other scripting languages #such as awk, icon, perl, rexx, and tcl. For this and many other reasons, #ksh is a much better scripting language than any of the other popular #shells"
> My shell is the ksh. How do I enable the history in this shell so that I can retrieve all previously > entered commands by pressing the "up" arrow key ?
I believe history is always enabled. Look at the section of the man page that mentions HISTFILE.
For the arrow keys, in your login profile export ENV=$HOME/.kshrc
in your .kshrc add this:
case $- in *i*) #interactive ksh # This stuff lets the arrow keys work in an xterm... set -o emacs alias __A=`echo "\020"` # up arrow == ^p == back a command alias __B=`echo "\016"` # dn arrow == ^n == down a command alias __C=`echo "\006"` # rt arrow == ^f == forward a character alias __D=`echo "\002"` # lf arrow == ^b == back a character esac |
|
|
| ksh setup with command history and nice prompt style |
[Sep. 23rd, 2008|01:26 pm] |
#ksh command history+nice prompt howto #get ksh from http://www.research.att.com/~gsf/download/ [download gunzip #and rename ksh and place in /bin, chmod 755, and link /usr/bin/ksh to #/bin/ksh] #http://www.kornshell.com/info/ # "The new version of ksh has the functionality of other scripting languages #such as awk, icon, perl, rexx, and tcl. For this and many other reasons, #ksh is a much better scripting language than any of the other popular #shells"
For the arrow keys, in your login profile [/home/user/.profile] export ENV=$HOME/.kshrc PS1="$LOGNAME@`uname -n` \$PWD\$ "
in your .kshrc add this:
case $- in *i*) #interactive ksh # This stuff lets the arrow keys work in an xterm... set -o emacs alias __A=`echo "\020"` # up arrow == ^p == back a command alias __B=`echo "\016"` # dn arrow == ^n == down a command alias __C=`echo "\006"` # rt arrow == ^f == forward a character alias __D=`echo "\002"` # lf arrow == ^b == back a character esac |
|
|