Saturday, February 23, 2013

How to get BASH shell behaviour on AIX server?

As you know BASH shell is having more advantages over any other Unix shells ... some of these features like command history,command editing by using up/down arrow keys, deleting/modifying typos ...

By default AIX uses ksh shell and we will not be able to get all of the above features what bash is having. This post will provide how to achive bash features on AIX machines.

Log in with your User name and you can see .profile under your home directory.

Take backup of your profile.
#cp -p /home//.profile /home//.profile.Date

Add the below lines to your .profile
#vi /home//.profile
set -o emacs
alias __A=`echo "\020"` # up arrow = ^p = back a command
alias __B=`echo "\016"` # down arrow = ^n = down a command
alias __C=`echo "\006"` # right arrow = ^f = forward a character
alias __D=`echo "\002"` # left arrow = ^b = back a character
alias __H=`echo "\001"` # home = ^a = start of line
export EXTENDED_HISTORY=ON


save the file.

Now restart your ssh session, you will be able to do bash operations in AIX machine.

No comments:

Post a Comment