The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: history in ksh
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-19-2001
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
users with one ID

If this is an application ID, I have a solution for you. This is not my script, but I offer it to you.

Set your login shell to /usr/bin/nologin for this shared user.
Next, login as yourself then su - username.

Use a script, put this in your .profile for the application, like this one below to keep track of individual history files.

When you su to root or an application ID this is great! Remember put this in your .profile for root or application .profile.

#***************************************
# sets .sh_hist file to id of user

if [ "`tty`" = "/dev/console" ]
then
REAL=console
else
REAL=`logname`
fi


HISTFILE=$HOME/.sh_$REAL
export HISTFILE
HISTSIZE=1000; export HISTSIZE
#****************************************