Jun 14, 2002 #1 unixadmin MIS Jan 27, 2003 11 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 Nov 29, 2000 73 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] }