Searching the output of last

John 'tms' Navarra navarra at casbah.acns.nwu.edu
Mon Apr 29 14:30:41 AEST 1991


In article <1991Apr29.040325.1822 at athena.mit.edu> jik at athena.mit.edu (Jonathan I. Kamens) writes:
>In article <1991Apr29.021236.12132 at casbah.acns.nwu.edu>, navarra at casbah.acns.nwu.edu (John 'tms' Navarra) writes:
>|> In article <1991Apr28.070748.5279 at bradley.bradley.edu> guru at buhub.bradley.edu (Jerry Whelan) writes:
>|> >	Does anyone have/know of a program to parse the output of the
>|> >'last' command and tell me who was logged in at some arbitrary time?
>|> >I'd like to be able to type: 
>|> >
>|> > 			whenwho 9:56
>|> 
>|>          do last | grep time  
>
>  I want to be polite, but I have an overwhelming urge to respond to this by
>saying, "Get a clue."
>
>  Mr. Whelan wants to know how to find out who was logged in at any particular
>time, not who logged in or logged out at any particular time.

 My bad! I misread the question. how bout setting up a program that has two
 arguments: a interval and a begining time. Then it looks thru utmp by
 doing a last | grep time ( might be slow) where time is the starting time
 and then increments it by one for interval loops. This will catch all 
 ocurrences of someone being logged in at a particular interval but the 
 trouble would be that you need some way to filter the output because it 
 will report a users name everytime thru the loop if he was logged on for
 more than a minute in the specified interval.                          
		Just a suggestion -- needs some work though.

>-- 
>Jonathan Kamens			              USnail:
>MIT Project Athena				11 Ashford Terrace
>jik at Athena.MIT.EDU				Allston, MA  02134
>Office: 617-253-8085			      Home: 617-782-0710


-- 
>From the Lab of the MaD ScIenTiST:
      
navarra at casbah.acns.nwu.edu



More information about the Comp.unix.questions mailing list