- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How create 2 differente history file for the same ...
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
06-08-2006 12:51 AM
06-08-2006 12:51 AM
How create 2 differente history file for the same login ?
Ksh
We are 2 people who use the same login (for database administration).
So we use the same history file.
I find a solution to know the client IP PC, then I can use specific variable for each users.
Where and what is the environment variable to solve this newbie problem ?
Thank you for you help.
What is the best solution to create
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 12:59 AM
06-08-2006 12:59 AM
Re: How create 2 differente history file for the same login ?
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=941849
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:01 AM
06-08-2006 01:01 AM
Re: How create 2 differente history file for the same login ?
You shouldn't share the login. Login as yourself and then su to the DBA login.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:02 AM
06-08-2006 01:02 AM
Re: How create 2 differente history file for the same login ?
use that approach to add the client hostname to the HISTFILE definition in .profile:
remhost=`who am i -R | awk '{print(substr($NF,2,length($NF)-2))}'`
HISTFILE=/tmp/hist.$LOGNAME.$remhost
export HISTFILE
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:06 AM
06-08-2006 01:06 AM
Re: How create 2 differente history file for the same login ?
I forget to say it explicitly: my previous solution is NOT selecting different history files on a per username-of-incoming-user base but on a per localuser-of-incoming-hostname base.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:19 AM
06-08-2006 01:19 AM
Re: How create 2 differente history file for the same login ?
I put in .profile :
HISTFILE=$HOME/.sh_history.tmp
export HISTFILE
I use an other terminal for a new login,
I test echo $HISTFILE
no problem.
But the history is always in .sh_history ?!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:30 AM
06-08-2006 01:30 AM
Re: How create 2 differente history file for the same login ?
create the history file in using
touch $HISTFILE
Log off an on again, then do
echo $HISTFILE
pwd
ls -l $HISTFILE
Check/send the output.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 01:36 AM
06-08-2006 01:36 AM
Re: How create 2 differente history file for the same login ?
/home/toto/.sh_history.tmp
toto@hp2:/home/toto> pwd
/home/toto
toto@hp2:/home/toto> ls -l $HISTFILE
-rw------- 1 toto dba 0 Jun 8 15:16 /home/toto/.sh_history.tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 02:30 AM
06-08-2006 02:30 AM
Re: How create 2 differente history file for the same login ?
if you start a subshell, do you get entries in $HISTFILE ?
pwd
ls -l $HISTFILE
or as second test:
...
If that fails, send yout .profile.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 02:39 AM
06-08-2006 02:39 AM
Re: How create 2 differente history file for the same login ?
Then I put in the end of .profile the line :
exec ksh
I don't know if it is the best solution, but it works ....
Thank you for you help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 03:29 AM
06-08-2006 03:29 AM
Re: How create 2 differente history file for the same login ?
perhaps you better try to put the HISTFILE stuff in ~/.kshrc like this:
In .profile:
...
ENV=~/.kshrc
export ENV
In .kshrc put all really ksh components:
HISTFILE=...
HISTSIZE=192
FCEDIT=vi
...
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 03:47 AM
06-08-2006 03:47 AM
Re: How create 2 differente history file for the same login ?
I have a group of administrators who work with the same account, so in order to have different history files, I added to .profile:
export HISTFILE=/tmp/hist$(tty|sed 's?/??g')
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 04:08 AM
06-08-2006 04:08 AM
Re: How create 2 differente history file for the same login ?
The previous solutions should have worked...
The reason it doesnt will be diificult to answer for you didnt say HOW you connetc yourself!
If CDE for instance it may be you left in .dtprofile:
> # DTSOURCEPROFILE=true
So read carefully and if you meet the prereqs
uncomment the line!
Then it will take into account .profile
All the best
Victor