- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using command line up arrow/down arrow
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
Forums
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
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
06-07-2010 11:23 AM
06-07-2010 11:23 AM
I am new to HPUX but have extensive experience on Tru64.
I would like to configure my terminal access to allow use of the up arrow and down arrow for command recall. I have done this in Tru64 by using ksh and setting the editor to emacs (set -o emacs). I use an old terminal emulator called KEA. It can be configured to emulate vt100 or vt400 (7 bit and 9 bit).
So far, I have been unable to get the arrow keys to work properly without actually mapping them via the KEA maps which causes other issues.
I don't like using vi for the command line editor.
Someone recommended installing and using bash instead of ksh, but I would prefer keeping the system shells native to HPUX.
I am running HPUX 11iV3 (B.11.31).
Is there any simple mechanism to configure this? Should I load bash?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 11:34 AM
06-07-2010 11:34 AM
Re: Using command line up arrow/down arrow
I think you covered your options: use 'bash' or learn 'vi' at least insofar as using it as a command editor.
Whatever you do, do *not* change the default shell for 'root' from '/sbin/sh' [the POSIX shell in HP parlance]. To do so will lead to an un-startable system. You can temporarily change to the 'bash' shell as root. Simply don't make it the default login shell.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 11:50 AM
06-07-2010 11:50 AM
Re: Using command line up arrow/down arrow
I have already changed the root shell to ksh. Would this also be an issue?
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 12:07 PM
06-07-2010 12:07 PM
Re: Using command line up arrow/down arrow
> I have already changed the root shell to ksh. Would this also be an issue?
Yes. The default root login shell as defined in '/etc/passwd' *must* remain '/sbin/sh'. This is a statically linked executable that doesn't use shared libraries found in '/usr'. Thus, during startup, before '/usr' is mounted, a fully functional runtime environment exists. Shells other than '/sbin/sh' live in the '/usr' directory and use shared libraries from that mountpoint.
The HP-UX POSIX shell ('/sbin/sh' for root and '/usr/bin/sh' for non-root users) is really as superset of the Korn (ksh88) shell available as '/usr/bin/ksh'. You should have no problems with the POSIX shell if you are accustomed to using 'ksh'.
A Korn93 version of 'ksh' is available as '/usr/dt/bin/dtksh' if you want the enhancements of Korn93. In 11.31, however, you must have loaded the CDE bundle for this to be available.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 12:36 PM
06-07-2010 12:36 PM
Re: Using command line up arrow/down arrow
I've changed it back to /sbin/sh.
Thanks for the heads up.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 01:32 PM
06-07-2010 01:32 PM
Re: Using command line up arrow/down arrow
> Okay, thanks.
If you have found the answers you received, helpful, please read:
http://forums.itrc.hp.com/service/forums/helptips.do?#28
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 04:20 PM
06-07-2010 04:20 PM
Re: Using command line up arrow/down arrow
I'd go with bash. By default, it does command history via arrow keys. You'll just have to invoke the shell by hand after you log in. No biggie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 04:47 PM
06-07-2010 04:47 PM
Re: Using command line up arrow/down arrow
Arrow keys can work in Ksh.
Add into .kshrc
set -o emacs
alias __A='^P'
alias __D='^B'
alias __B='^N'
alias __C='^F'
Where:
^P type as CTRL-V CTRL-C P
^B type as CTRL-V CTRL-C B
...
Some of my students asked me this questions
in the past.
Cheers,
VK2COT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2010 05:14 PM
06-07-2010 05:14 PM
Re: Using command line up arrow/down arrow
> by hand after you log in. [...]
Or exec the thing from the shell start-up
scriptlet (only) if "/usr" is mounted. As
usual, many things are possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2010 01:15 AM
06-08-2010 01:15 AM
Re: Using command line up arrow/down arrow
This may not be good enough. You should make sure that /usr/local/bin/ (if bash is there) is available and all the shlibs and dld are also available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 06:52 AM
06-11-2010 06:52 AM
Re: Using command line up arrow/down arrow
I've set up the .kshrc file. I can get my shell to recognize the up and down arrows, but all they do is echo on the command line as "^P" and "^B", etc.
Am I missing something else?
Also. I don't understand what you mean by:
Where:
^P type as CTRL-V CTRL-C P
^B type as CTRL-V CTRL-C B
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 06:59 AM
06-11-2010 06:59 AM
Re: Using command line up arrow/down arrow
I've loaded bash (bash-4.1.005-ia64-11.31.depot, termcap-1.3.1-hppa-11.11.depot, and gettext-0.16.1-hppa-11.11.depot -- the last two were the latest versions I could find)They all loaded successfully with swinstall.
However, when I invoke "bash" I get messages like:
/usr/lib/hpux32/dld.so: Unable to find library 'libtermcap.so'
I find the lib file it is looking for and link it back into /usr/lib/hpux32 but then it just goes to another lib file it can't find.
Two questions:
1) Why is it looking in hpux32 when I loaded a 64bit version of bash?
2) I tried setting LD_LIBRARY_PATH to various directories including where I've found the files it is looking for, but that does not seem to work. Is there another environment variable I need to set?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 07:13 AM
06-11-2010 07:13 AM
Solution^P type as CTRL-V CTRL-C P
^B type as CTRL-V CTRL-C B
I think that should be:
CTRL-V CTRL-P
CTRL-V CTRL-B
You need CTRL-V to escape the next char.
>1) Why is it looking in hpux32 when I loaded a 64bit version of bash?
Why do you think it is 64 bit? The kernel and dld.so don't lie.
>2) I tried setting LD_LIBRARY_PATH to various directories including where I've found the files it is looking for
What does "chatr /path-to-bash/bash" show?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 07:49 AM
06-11-2010 07:49 AM
Re: Using command line up arrow/down arrow
My uname -a output shows:
HP-UX srvunx01 B.11.31 U ia64
Isn't that 64 bit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 09:21 AM
06-11-2010 09:21 AM
Re: Using command line up arrow/down arrow
The escape character before the Control P was the final issue (with that anyway, I still don't know why bash doesn't work.)
To recap:
LEAVE ROOT as sh!
For other users, or when invoking ksh after logging in as root:
In the user's .profile
ENV=~/.kshrc; export ENV
In the user's .kshrc enter:
set -o emacs
alias __A='^P'
alias __B='^B'
alias __C='^N'
alias __D='^F'
When entering the aliases, DO NOT cut and paste the above. The characters must be escaped with CONTROL V. So, for example ^P would be typed "CONTROL V CONTROL P", etc.
Thanks to everyone.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2010 01:57 PM
06-11-2010 01:57 PM
Re: Using command line up arrow/down arrow
It's more work, but I've found it useful to
build most GNU stuff from the sources.
(Pulling a loose strand of GNU yarn does tend
to result in a lap filled with what looks
like the annual output of a whole herd of
sheep, but sometimes it's actually finite.)
When all the builds are done on your own
system, finding all the run-time stuff seems
to be less of a problem.
The current kit seems to be version 4.1 with
seven patches available, resulting in:
dyi # bash --version
GNU bash, version 4.1.7(1)-release (ia64-hp-hpux11.31)
Copyright (C) 2009 Free Software Foundation, Inc.
[...]
http://www.gnu.org/software/bash/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2010 05:11 AM
06-12-2010 05:11 AM
Re: Using command line up arrow/down arrow
No and yes. This is just a name so it doesn't show the mode of a particular program.
But the hardware always runs in 64 bit mode so it is only with software smoke and mirrors can you have a 32 bit application.
And the default compile mode is +DD32.
>Thanks to everyone.
If you are happy with the answers you were given, please read the following about how to assign points:
http://forums.itrc.hp.com/service/forums/helptips.do?#33