[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-admin
Subject:    [HPADM] SUMMARY: Different Command Histories
From:       "Ahmed, Nabeel" <Nabeel_Ahmed () bose ! com>
Date:       2001-02-28 19:31:24
[Download RAW message or body]

Thanks to Wolf-Dietrich, Ryan, Roger, Allan, Martin, Rodney, Sean, Matthew,
& Anthony.

Very do-able, and in a variety of ways too.
 
The response from Wolf-Dietrich covered them all.

I used the second one, where if saves command histories from session to
session, so long as they come in from the same machine.

Thanks all. Original question at the end.

Nabeel


----------------------------

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 ;-)

HTH,
   Wodisch


----------------

"Ahmed, Nabeel" <Nabeel_Ahmed@bose.com> on 28.02.2001 18:08:51


Hi,

I have 3 human beings using the same login, why? Coz it is the one that the
application uses and they need to use that login too.
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.

TIA,

Regards,
Nabeel

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact
majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner:
owner-hpux-admin@dutchworks.nl

 Archives:  ftp.dutchworks.nl/pub/digests/hpux-admin       (FTP, browse
only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse &
search)




--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic