Jun 14, 2002 #1 unixadmin MIS Joined Jan 27, 2003 Messages 11 Location US I need to find out the last time the "finger" command was done on our account in my home directory. This is on a Solaris 7 system and will help us to find out recent "finger" commands.
I need to find out the last time the "finger" command was done on our account in my home directory. This is on a Solaris 7 system and will help us to find out recent "finger" commands.
Jun 14, 2002 #2 badco Programmer Joined Nov 29, 2000 Messages 73 Location US I would use stat. Each time you are fingered the .plan file in your home directory is accessed. Try this: [tt] #!/usr/local/bin/perl $file = "./"; opendir(HOME,$file) || die "Could not open: $!\n"; @files = readdir(HOME); close(HOME); for(@files) { if ($_ =~ m/\.plan$/) { $mod = localtime ( (stat($_))[8]); print "$_ last accessed: $mod\n"; }[/tt] } Upvote 0 Downvote
I would use stat. Each time you are fingered the .plan file in your home directory is accessed. Try this: [tt] #!/usr/local/bin/perl $file = "./"; opendir(HOME,$file) || die "Could not open: $!\n"; @files = readdir(HOME); close(HOME); for(@files) { if ($_ =~ m/\.plan$/) { $mod = localtime ( (stat($_))[8]); print "$_ last accessed: $mod\n"; }[/tt] }