How to make HP-UX Korn shell similar to Linux Bash

October 26, 2012 by 2 Comments 

Working as Oracle DBA on HP-UX and Linux both I prefer Bash shell which is available on Linux compared to Korn shell which is default shell on HP-UX. It’s more convenient to work on Linux Bash using handy key combinations, etc. Unfortunately Bash is not installed on HP-UX by default and also not officially supported there – you will not get help from HP support if problems with it arise.

Nevertheless, I could find a way of improving environment settings on HP-UX to make the backspace and some other keys work similar to Linux and Bash shell. See below my usual .profile file on HP-UX.
If somebody has more useful tips on environment settings or key combinations on HP-UX, feel free to comment.

stty kill "^U" intr "^C" erase "^?" eof "^D" susp "^Z" dsusp "^Y" \
hupcl ixon ixoff cs8 -istrip
umask 027
export PATH=$PATH:/sbin
EDITOR=vi ; export EDITOR
# Enable usage of arrow keys in command line
# If not set, use (Esc-K/Esc-J for command repeat)
set -o emacs
alias __A=`echo "\020"` # up arrow = back a command
alias __B=`echo "\016"` # down arrow = down a command
alias __C=`echo "\006"` # right arrow = forward a character
alias __D=`echo "\002"` # left arrow = back a character
alias __H=`echo "\001"` # home = start of line; work with Putty -> Function Keys=SCO
alias __Q=`echo "\005"` # end = end of line - does not work for me
# Some sets for vi & avoid exit on Ctrl-d
set -o ignoreeof

Some other key combinations I use:
– Esc-H – Remove a line


Enjoyed this article? Please share it with others using the social site of your choice:


2 Responses to “How to make HP-UX Korn shell similar to Linux Bash”
  1. Suzette B. Hays says:

    The oraenv and coraenv utilities both aid in setting the Oracle environment on UNIX / Linux systems (other utilities exist on Windows platform that enable the Oracle Home to be set.) The coraenv utility is appropriate for the UNIX / Linux C Shell; oraenv should be used with either the Bourne or Korn shells.

  2. Jag says:

    It worked for Meee, Thanks a lot 😉

Add a Comment

We welcome thoughtful and constructive comments from readers.
If you want your own picture to show with your comment?
Go get a Globally Recognized Avatar!

DBMS Blog Updates : Subscribe RSS RSS: Subscribe to Articles · Subscribe to Comments Subscribe RSS Receive site updates via email