- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- problem with history..
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
08-25-2003 02:22 AM
08-25-2003 02:22 AM
my problem is when I enter as a root, I can't recall history (Esc + k). when I type "history" the output is as bellow:
"sh: fc: Cannot access or open the history file"
but, when I login as another user, it works fine..
can anyone help me with this...?
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:29 AM
08-25-2003 02:29 AM
Re: problem with history..
HISTFILE=/tmp/.sh_history.$(whoami)
Then make sure you've done "set -o vi" and that should do it.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:30 AM
08-25-2003 02:30 AM
Re: problem with history..
For root the shell is /sbin/sh. History details are only available with Korn/C shells.
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:30 AM
08-25-2003 02:30 AM
Re: problem with history..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:32 AM
08-25-2003 02:32 AM
Re: problem with history..
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:50 AM
08-25-2003 02:50 AM
Re: problem with history..
-Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 02:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 11:03 AM
08-25-2003 11:03 AM
Re: problem with history..
If you run
su root
then you won't have a history file, but if you
su - root
then you will have a history file (if one is set in your /.profile).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 11:18 AM
08-25-2003 11:18 AM
Re: problem with history..
It help track operator mistakes, all kinds of good things.
I do it in /etc/profile
HISTFILE=$HOME/.sh_history
HISTSIZE=5000
I know this is similar to other answers, but this is how I do it.
I have had users who were trying to cover their tracks or hide mistakes try and turn it off in their .profile so thats another reason to make it mandatory. To date no applications have been broken by this policy.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2003 12:14 PM
08-25-2003 12:14 PM
Re: problem with history..
Good point.
If you have a role account with several users logging in with the same ID, you can keep track of the different histories with something like this:
HDAT=$(date +%y%m%d.%I%M%S)
HWHO=$(who am I -R | /awkc 6)
HTTY=$(tty | tr "/" " "|awk '{ print $NF }')
export HISTFILE=/home/roleacct/.hist/$HDAT.$HTTY.$$.$HWHO.log
This gives you the history files separated by login date, time, tty, process, and hostname/IP address.
Rob