07-27-2013 09:30 AM
I'm pretty new to the HP-UX. I cannot make the backspace and edit if something goes wrong. I understand there is no Bash in HP-UX, however is there any options available.
07-27-2013 09:54 AM
The bash shell is not available in HP-UX by default. However you can install it and get the bash functionality.
It is available in folloing link.
If you need the bash shell only for backspace function, then you set the terminal as below.
if you want it to be permanently, edit your .profile file.
#stty erase ^?
07-27-2013 12:51 PM
There's a space between the 'erase' and the '^?'. To get the '^?' character just hit the backspace key after entering 'stty erase '. The '^?' should echo to the screen. Then you can hit enter.
# stty erase <hit backspace key here>
07-27-2013 02:27 PM
As a hp-ux (or unix in general) user to should know or learn some basics.
Hope this helps!
There are only 10 types of people in the world -
those who understand binary, and those who don't.
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! star in the left column!
07-27-2013 06:11 PM
>#stty erase ^?
This depends on what your terminal emulator sends. I want the backspace key and control-H to do the same thing so I have to use: stty erase ^h
>To get the '^?' character
You can also type this as two separate chars or the DEL char.
>Default command line editing is just like using vi.
You can confirm this in a real shell by doing:
$ set -o
And check if vi or emacs is set.
07-27-2013 09:28 PM - edited 07-28-2013 09:53 AM
I'll take a guess that you are using PuTTY as your terminal emulator. This very popular (and free) program has one very annoying default: the backspace key is mappopen the ed to the DEL (delete) key, *not* the backspace key. So when you use the backspace key, you'll see ^? on the screen which is the shell's way of showing you this invisible character. To change your emulator to use the backspace key (for PuTTY), open the Configuration window and select:
Terminal -> Keyboard
and change the Backspace key from Control-? to Control-H (which is the backspace key. Be sure to save this new setting.
Another possibility is that your TERM value has been set to "vt100" and unfortunately, the terminfo database defined the ERASE key as Delete. This can be seen with the command: untic vt100, and look for the capname "kbs" which refers to the keyboard backspace character. For (IMHO) sane settings, look at untic hp and you'll see kbs=\b which means that the backspace (action to erase the previous character) is backspace and not 177 which is the Delete key.
To fix the default TERM value, add this line to your profile:
Set your .profile and alsoterminal emulator.
Why is backspace mapped to the Delete key? Most likely the original designers for PuTTY and terminfo settings were OpenVMS or DEC OS users where the erasing of a character meant pressing the Delete key. Just a guess...
Once you are able edit your lines with the backspace key, the next (non-intuitive) change is to enable command line recall. This requires several changes:
1. Your shell must be the POSIX shell (/usr/bin/sh or /sbin/sh) or ksh. Note that the Bourne shell is obscured in the /usr/old/bin directory -- don't use it.
2. Edit your .profile to add these lines:
3. Create the history file:
4. Logout and login again. Type a command like ls. Then type ESC k (the Escape key followed by the letter k). You should see the ls command echoed on the line ready to edit. Verify that the history can be shown by typing the command: history
There are several command line recall/edit features. Read the man pages for sh-posix (shortcut: man fc) or man ksh and look for Command Line Editing and vi Editing.