- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- shell question
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-27-2006 10:12 AM
08-27-2006 10:12 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2006 10:35 AM
08-27-2006 10:35 AM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2006 12:16 PM
08-27-2006 12:16 PM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2006 12:56 PM
08-27-2006 12:56 PM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2006 02:37 PM
08-27-2006 02:37 PM
Re: shell question
If i am not mistaken each session can have it's own recorded history, and if you run a:
"env |grep -i histfile" you should find your relevant history file.
I hope this helps.
Regards,
Erkan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2006 05:03 PM
08-27-2006 05:03 PM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 12:59 AM
08-28-2006 12:59 AM
Re: shell question
NOTE: if HISTFILE isn't set, no history file is used. This is different from the original Korn shell, which uses $HOME/.sh_history; in future, pdksh may also use a default history file.
So by default your ksh history is only temporarily stored in a buffer and will be lost when you log out. To make it permanent you can use the following line in ~/.bash_profile (if bash is your login shell);
export HISTFILE=${HOME}/.sh_history (or whatever you want to call it). You will need to logout/login to take affect.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 01:48 AM
08-28-2006 01:48 AM
Re: shell question
cat .sh_history
Jean-Pierre Huc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 02:06 AM
08-28-2006 02:06 AM
Re: shell question
To change $HISTFILE for ksh without affecting bash, execute the following from bash:
$ (HISTFILE=
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 03:01 AM
08-28-2006 03:01 AM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 04:07 AM
08-28-2006 04:07 AM
Re: shell question
When as root # I issue a ksh -o vi I find that my history is in the file
.sh_history
please note the dot before file name ".sh_history"
I have done not setup on my ksh enviroment this is default.
Jean-Pierre Huc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2006 04:23 PM
08-28-2006 04:23 PM
Re: shell question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2006 06:05 AM
09-02-2006 06:05 AM
Re: shell question
Again, to reiterate the problem: RHEL3, root's default shell is /bin/bash. If user su's to root and issues command "ksh -o vi", their history only logs while they are actively in that session. After they log out, history is gone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 05:21 AM
09-06-2006 05:21 AM
SolutionSorry for the late reply on this. I got tied up with some projects I'm working on and haven't had a chance to check back.
You can get permanent history as already mentioned. You will just have two history files.
Just add "export HISTFILE=${HOME}/.sh_history" to root's ~/.bashrc file.
When someone logs in as root they will have their bash history (in ~/.bash_history). Then if someone runs 'ksh -o vi' their history will be recorded in ~/.sh_history.
You can technically point HISTFILE to ${HOME}/.bash_history, but it won't work right as the formatting is different.
Also, you might get a little more input from other forum members if you assign points. Members can easily see that you have only assigned points to one out of 94 reponses. Most of the members in the forums will help either way, but it can't hurt.
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 05:41 AM
09-06-2006 05:41 AM
Re: shell question
Thanks for the response. That is exactly what I want. Thank you for the advice as well. I will heed it moving forward.
Regards, Joe