- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell history not being written to specified histo...
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
04-24-2009 07:12 AM
04-24-2009 07:12 AM
Shell history not being written to specified history file
HISTFILE=$HOME/.$LOGNAME"_history"
date>>$HISTFILE
#print -s "### login at `/usr/bin/date` ###"
export HISTFILE
HISTSIZE=500
export HISTSIZE
All I get in my history file is the date/time I log in:
Thu Apr 23 15:47:13 CDT 2009
Fri Apr 24 10:03:04 CDT 2009
Fri Apr 24 10:04:34 CDT 2009
All of the command history is still being stored in .sh_history.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 07:20 AM
04-24-2009 07:20 AM
Re: Shell history not being written to specified history file
If the home directory is on NFS may not work.
I would try setting it this way:
HISTFILE="${HOME}/.${LOGNAME}_history"
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
04-24-2009 07:22 AM
04-24-2009 07:22 AM
Re: Shell history not being written to specified history file
# env |grep HIST
HISTFILE=/tmp/.sh_history.root
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 07:55 AM
04-24-2009 07:55 AM
Re: Shell history not being written to specified history file
Try setting the variable in your home account .profile and logging out and back in again and you it should work ok :
vi .profile
~
~
alias checkfs='/home/markme/bin/monitor_fs/check_fs.sh'
HISTFILE=$HOME/.$LOGNAME"_history"
export HISTFILE
~
~
/home/markme# ls -ail .markme*
9381 -rw------- 1 markme users 48 Apr 24 16:53 .markme_history
gba70102:/home/markme#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 08:32 AM
04-24-2009 08:32 AM
Re: Shell history not being written to specified history file
Here's the output of env|grep HIST:
env|grep HIST
HISTFILE=/home/bsimpson/.bsimpson_history
HISTSIZE=500
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 08:34 AM
04-24-2009 08:34 AM
Re: Shell history not being written to specified history file
I made the changes in my /home .profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 08:45 AM
04-24-2009 08:45 AM
Re: Shell history not being written to specified history file
Sorry - I did not read the original posting thoroughly.
If you have logged logged out and back in again it should be working.
The variable is not set in the /etc/profile with a "readonly" against it, which would prevent it from being amended ?
Regards,
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 10:07 AM
04-24-2009 10:07 AM
Re: Shell history not being written to specified history file
There's no reference to HISTFILE or any history in /etc/profile.
I agree that this should work, but can't figure out why it's not!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 10:15 AM
04-24-2009 10:15 AM
Re: Shell history not being written to specified history file
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 12:32 PM
04-24-2009 12:32 PM
Re: Shell history not being written to specified history file
Where are you defining HISTFILE? Near the top of your .profile?
I also use:
set -o nolog # don't save functions in history file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 01:24 PM
04-24-2009 01:24 PM
Re: Shell history not being written to specified history file
I believe it's running .profile since the variables I defined there are being assigned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2009 01:30 PM
04-24-2009 01:30 PM
Re: Shell history not being written to specified history file
Very near the top of .profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2009 09:49 AM
04-27-2009 09:49 AM
Re: Shell history not being written to specified history file
do once a
touch $HISTFILE
and re-login.
Then check for updates of this file.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2009 10:44 AM
04-27-2009 10:44 AM
Re: Shell history not being written to specified history file
I just tried that with the same results. Still just getting the date that I logged in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2009 07:14 PM
04-27-2009 07:14 PM
Re: Shell history not being written to specified history file
Throw everything in your .profile away.
Just have:
export HISTFILE=$HOME/.${LOGNAME}_history
export HISTFILE=500
date >> $HISTFILE
See if this works.
Ah, you absolutely can't do this:
date >> $HISTFILE
The shell history file is a binary file and you can't fiddle with it.
And I don't really see how to get a command with a date in the history file, unless you type it in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 07:41 AM
04-28-2009 07:41 AM
Re: Shell history not being written to specified history file
I've tried that and it didn't work either. It wrote nothing to the $HISTFILE that I defined. If I do an echo $HISTFILE, it shows that valus that I defined.
Just keeps writing to the .sh_history file. Is there somewhere else that I need to define the history file that I want to user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:07 AM
04-28-2009 08:07 AM
Re: Shell history not being written to specified history file
No, this works fine for ksh. What shell are you using and are you talking about root?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:11 AM
04-28-2009 08:11 AM
Re: Shell history not being written to specified history file
I just created the same test user on a different server and it worked great. So, no I'm wondering if something is set up on this server that's stopping it from working. There must be some setting that's preventing it from working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:20 AM
04-28-2009 08:20 AM
Re: Shell history not being written to specified history file
Have you removed the corrupted history file?
Is $HOME over NFS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:25 AM
04-28-2009 08:25 AM
Re: Shell history not being written to specified history file
If I login and then type ksh, then it starts logging to the correct history file. So, it appears that my ksh shell is not being invoked on login?
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:43 AM
04-28-2009 08:43 AM
Re: Shell history not being written to specified history file
I don't what you mean be "corrupted" file. It's not using NFS at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:44 AM
04-28-2009 08:44 AM
Re: Shell history not being written to specified history file
What does $SHELL show (or your shell entry in /etc/passwd) before you switch?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 08:50 AM
04-28-2009 08:50 AM
Re: Shell history not being written to specified history file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 09:23 AM
04-28-2009 09:23 AM
Re: Shell history not being written to specified history file
something of a time long ago comes into my mind:
Tell us please: what is the OS version you use?
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2009 09:45 AM
04-28-2009 09:45 AM
Re: Shell history not being written to specified history file
$ what /bin/ksh
HP-Server-Literate since 1979