- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: recall previous command using esc-k
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
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
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-02-2010 01:20 PM
тАО06-02-2010 01:20 PM
Solved! Go to Solution.
- Tags:
- history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2010 01:35 PM
тАО06-02-2010 01:35 PM
Re: recall previous command using esc-k
set EDITOR=vi
set -o vi
Try the above without the first line, if it works, great. If not, try it again with the set EDITOR command. If you need both, there's your fix.
If it's bash your using then the default history recall command is ctrl-r. The above changes it to act like ksh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2010 02:07 PM
тАО06-02-2010 02:07 PM
Re: recall previous command using esc-k
The system is HPUX B.11.00 and the user is root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2010 02:23 PM
тАО06-02-2010 02:23 PM
Solutionthen try your esc-k commands, if it doesn't work, then try:
set -o vi
then try your esc-k commands, if it doesn't
work, then try
set EDITOR=vi; export EDITOR (export shouldn't be necessary, but doesn't hurt).
Then try your esc-k commands, You should be working now.
FYI: as root, in the default posix shell, you generally don't have history turned on, check HISTSIZE.
echo $HISTSIZE
if this is zero, you don't have history. When you invoke ksh, you'll read the /etc/profile script, which by default has a HISTORY size setting, so this starts to work.
Alternately, you could just try setting HISTSIZE to something other than zero without using ksh. Then try esc-k,
then try setting "-o vi", then try esc-k, then try "set EDITOR=vi",then try esc-k.
When you've finally got a solution working, add the three "set" commands to your ~/.profile in your home directory, which is probably just "/", unless you've changed it.
put this in root's .profile, preferably at the end of the file.
set HISTSIZE=300
set EDITOR=vi
set -o vi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 04:13 AM
тАО06-03-2010 04:13 AM
Re: recall previous command using esc-k
Does this mean that I need to remember to type this command when ever I want to recall?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 06:21 AM
тАО06-03-2010 06:21 AM
Re: recall previous command using esc-k
> type this command when ever I want to
> recall?
If you wish to use command-line recall in a
shell, then you probably need to use a shell
which does command-line recall. If the
normal "root" shell doesn't do it, then you
might need to run some other shell, like,
say, "ksh" or "bash".
Changing the default "root" shell on an
HP-UX system is generally a very bad idea, so
you may be better off manually running the
other shell when you log into the HP-UX
system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 06:41 AM
тАО06-03-2010 06:41 AM
Re: recall previous command using esc-k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 06:55 AM
тАО06-03-2010 06:55 AM
Re: recall previous command using esc-k
Put the three "set" commands there, and when you run "ksh" it will run the contents of the ".profile" file. Oh, yeah and make sure the file is executable for root: "chmod u+x .profile"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 08:32 AM
тАО06-03-2010 08:32 AM
Re: recall previous command using esc-k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 10:07 AM
тАО06-03-2010 10:07 AM
Re: recall previous command using esc-k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-03-2010 06:47 PM
тАО06-03-2010 06:47 PM
Re: recall previous command using esc-k
This is fairly annoying so I always put the EDITOR, HISTFILE and HISTSIZE variables in /etc/profile. Now every user gets the correct settings. Using .profile or .kshrc means that the fix must be applied for every user login on the system.
By the way, set HISTFILE to a reasonable value like 10000 (not 300). The purpose is to log previous commands and being able to recall something from 6 months ago can be a very important requirement.
Now you know how to enable the POSIX shell for command history, change root's shell back to /sbin/sh. As mentioned, ksh will not function in single user mode. The POSIX shell and ksh are virtually identical for most sysadmins.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2010 08:49 AM
тАО06-04-2010 08:49 AM
Re: recall previous command using esc-k
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-04-2010 09:08 AM
тАО06-04-2010 09:08 AM