Keeping Track of my Login/outs?csh script

Keeping Track of my Login/outs?csh script

Post by Graphix0 » Sun, 08 Jan 1995 13:34:02



I would like to alter my ".logout" file in csh to add(CAT) to a file so
that I could
keep track of the hours spent and on which host /sun or sgi etc. Is there
a
script in csh that could accomplish this?

Any help GREATLY appreciated.

Dave.
Dave who?
Dave.
Dave's not here.

------------------------------------------
D. Christian Ehlers

 
 
 

Keeping Track of my Login/outs?csh script

Post by the mol » Tue, 10 Jan 1995 05:41:47



Quote:> I would like to alter my ".logout" file in csh to add(CAT) to a file so
> that I could
> keep track of the hours spent and on which host /sun or sgi etc. Is there
> a
> script in csh that could accomplish this?

> Any help GREATLY appreciated.

> Dave.
> Dave who?
> Dave.
> Dave's not here.

> ------------------------------------------
> D. Christian Ehlers

Hi David!

I have this in my .login:

  #erase the login date of the session previous to the last:
  rm -f .logindate.old

  #keep the login date of the previous session            
  mv .logindate.new .logindate.old

  #write the date as this session's login date
  date > .logindate.new

This is part of my .logout:

  #remove last sessions logout date
  rm -f .logoutdate

  #take current date as logout date
  date > .logoutdate

The following script informes me about my last session and the current:

  echo '           last session       |       this session'
  echo '                              |'
  echo -n 'from:  '`cat .logindate.old`
  echo '   |   '`cat .logindate.new`
  echo -n 'to:    '`cat .logoutdate`
  echo '   |  ' `date`

Perhaps it's not properly written or there might be easier ways to
achieve the same effect but it works for me.

tm

--
     /
__  __/   __  __                                                the mole

__/   __/ __/ __/    http://darkwing.uoregon.edu/~markusg/theburrow.html