- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command Line Editing - Please advise!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 09:30 AM
07-27-2013 09:30 AM
Command Line Editing - Please advise!
Hi
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.
Thank you
Sam
- Tags:
- bash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 09:54 AM
07-27-2013 09:54 AM
Re: Command Line Editing - Please advise!
Hi,
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.
http://hpux.connect.org.uk/hppd/hpux/Shells/bash-4.2.010/
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 ^?
Rgds...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 11:51 AM
07-27-2013 11:51 AM
Re: Command Line Editing - Please advise!
Thanks for your quick reply. I did tried as said above, but throwing some errory. Please advise. Thanks in advance.
# stty erase^?
unknown mode: erase^?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 12:51 PM
07-27-2013 12:51 PM
Re: Command Line Editing - Please advise!
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.
So:
# stty erase <hit backspace key here>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 02:27 PM
07-27-2013 02:27 PM
Re: Command Line Editing - Please advise!
As a hp-ux (or unix in general) user to should know or learn some basics.
Hope this helps!
Regards
Torsten.
__________________________________________________
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! thumb below!

- Tags:
- history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 06:11 PM
07-27-2013 06:11 PM
Re: Command Line Editing - stty
>#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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2013 09:28 PM - edited 07-28-2013 09:53 AM
07-27-2013 09:28 PM - edited 07-28-2013 09:53 AM
Re: Command Line Editing - Please advise!
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:
stty erase"^H"
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:
export HISTFILE=$HOME/.sh_history
export HISTSIZE=5000
export EDITOR=/usr/bin/vi
3. Create the history file:
touch $HOME/.sh_history
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.
Bill Hassell, sysadmin
- Tags:
- putty