The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




Thread: Logs
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-04-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,953
have the following command in the .profile of every user

script -a $LOGNAME

the above would generate all the output and commands entered in the file named $LOGNAME

and while disconnecting from the session,
the user has to specifically issue exit or ctrl-D twice
to quit from script process
and from the current shell

where process script is spawned over the current shell
later check for the file content redirected through script command and modify according to ur needs.

And,

to retrieve a copy of all the commands or characters entered by the user (including the control characters ) there should be a way to duplicate the output descriptor of the shell to redirect to STDOUT and the required filename.

May be the Gurus would help regarding this !!!