- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Using .sh_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
07-08-2007 10:33 PM
07-08-2007 10:33 PM
We have set the HISTFILE and HISTSIZE parameters in the user .profile in an Xwindows environment.
If the user does an su - user and logs in, then everything the user does is logged into the .sh_history file. Every day we will do an '> .sh_history' to zero the history file.
But if we open up a new xterm window or right click on the desktop and select a new xterm window, the newly entered commands are not logged into the .sh_history file. It seems like opening a new xterm window does not run the .profile, and the .profile needs to be run to make the history work, even though the xterm window is the correct user.
Is there any way around this problem, like forcing the .profile to run everytime a new xterm window is opened, or some other settings? Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 10:39 PM
07-08-2007 10:39 PM
Re: Using .sh_history
export HISTSIZE=5000 to the .profile, but the .sh_history file keeps on growing to much more than 5000 lines.
Is the .sh_history supposed to delete the old history lines when the HISTSIZE is reached, or what behavior should be expected?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 10:41 PM
07-08-2007 10:41 PM
Re: Using .sh_history
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 10:45 PM
07-08-2007 10:45 PM
SolutionNevertheless, the terminal windows ignore profiles. This occurs because Xwindows terminal emulators do not set the flag to put a dash in front of the login shell (ie, -sh or -ksh, etc) and this tells the kernel not to run the standard profiles. To fix this, do this in every Xwindow user's $HOME directory:
echo "*loginShell: true" >> $HOME/.Xdefaults
Now when you start an X11 terminal window you will see the normal login (ie, copyright messages, etc) and your environment will be correct. Note: there is a DTSourceprofile option that may be mentioned -- ignore that advice. It will not run /etc/profile and that means that the system-wide settings and tests will not be performed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2007 04:11 AM
07-09-2007 04:11 AM
Re: Using .sh_history
export HISTSIZE=5000 to the .profile, but the .sh_history file keeps on growing to much more than 5000 lines.
You will be able to see more than 5000 lines by looking at the file but history can only list the last 5000 lines. To me this is a GOOD thing.
>Is the .sh_history supposed to delete the old history lines when the HISTSIZE is reached, or what behavior should be expected?
You are not suppose to look behind the green curtain (.sh_history). ;-)
I've had the file reach 32K lines and then I have lots of problems. :-(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2007 02:45 PM
07-09-2007 02:45 PM