- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .sh_history
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
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
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
03-01-2001 04:47 AM
03-01-2001 04:47 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 06:15 AM
03-01-2001 06:15 AM
Re: .sh_history
The first esc-k brings back the last command I did in each session, the next esc-k actually reads the file and brings back the combined history commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 08:37 AM
03-01-2001 08:37 AM
SolutionIf you view the .sh_history file with cat -v or od, you will notice that it is not entirely text. The "extra" null characters are somehow keeping track of the current session as opposed to the entire file. Too bad the man page for sh-posix(1) doesn't say anything about the format of the .sh_history file.
--Bruce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 09:35 AM
03-01-2001 09:35 AM
Re: .sh_history
They asked...
.."I have 3 users using the same login.
I want them to have different command histories, is it possible? If so, how? The shell is k-shell, and system is running 10.20. "
Here's some of the suggestion given that may help you:
..do your users need to save their histories over logoff/re-logon?
1) If not, well, how about a "$HOME/.profile" like this:
#!/usr/bin/ksh
.
. # you stuff stays here...
.
export HISTFILE=$HOME/.sh_history.$$
export HISTSIZE=1000
set -o vi
set -o viraw
trap "rm $HISTFILE" 0
# end of .profile
That way everybody gets his/her own history file (their wish) and at the end of the session it will be removed, hence not clogging your diskspace.
2) If they need to continue with their resp. histories after re-login, but each one stays at his/her PC (I guess), then exchange the following line in the example above and delete the "trap" line:
export HISTFILE=$HOME/.sh_history.$(who -u am I | cut -c52-)
That should do the trick for this second case.
3) And if they do login from different places each and every time you do not have many choices but asking them upon loggin in (same line exchanged as before, but now for multiple lines):
traps=$(trap) #remember the traps
trap "" 1 2 3 15 #stop interrupt keys...
name="" #no default name
while [ -z "$name" ] #repeat until entered
do echo "Enter your name: \c" #ask them
read name #get the answer
done #until they entered a name
export HISTFILE=$HOME/.sh_history.$name #set history file
$traps #reset the traps
unset name traps #forget the helping variables
At least they are forced to enter a name - you just have to make shure they do enter the same name every time ;-)
Hope this helps,
/rcw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2001 03:27 PM
03-01-2001 03:27 PM
Re: .sh_history
thanks for posting my posting from HPADM without
showing my name ;-)
Wodisch